Tagged Questions

BASH is the Bourne Again SHell, the successor to the classic Unix sh (shell). It's the official shell of GNU.

learn more… | top users | synonyms

3
votes
1answer
31 views

Bash Script(beginner) - Code Improvement Suggestions

I am writing a simple script to automate my regression testing. I am new to bash scripting and my goal is achieve the most efficient and clean code. I have written a simple function to allow me to ...
3
votes
1answer
36 views

A little bash function, assigning attributes

This function checks if an attribute has been passed and if not, asks user for input. I'm new in bash scripting and would like to get some feedback. Is it okay or should I refactor this code somehow ...
5
votes
3answers
36 views

Can I speed up this simple versioning/backup script?

I'm writing a simple automatic backup/versioning bash script. It should basically mirror a directory structure somewhere, and then copy files over there when they've been altered. The ghost files ...
-1
votes
0answers
28 views

Bash script to copy|move untracked SVN|GIT files from repository [closed]

I am learning shell scripting at the moment and, as an exercise, I wrote a little script to copy/move all untracked files and folders from my GIT/SVN repository to the output directory. Project ...
2
votes
1answer
75 views

An attempt at making a neat ls

This is a simple script to make ls output first folders, then files, then other stuff (symlink). I think this is really neat and would like to share the script in exchange for comments. It should be ...
2
votes
1answer
49 views

Am I making any beginner errors in the bash script for adding trusted timestamps to Git commits?

I don't write too many bash scripts and I can usually struggle my way through getting the odd thing I need working, but my scripts always seem to feel a bit brittle. Below is a script I wrote for ...
1
vote
1answer
59 views

Run all scripts in a sub-directory

When git runs my post-receive hook, I'd like it to run all the scripts in the subdirectory post-receive.d. My script is as follows #!/bin/bash SOURCE="${BASH_SOURCE[0]}" DIR="$( dirname "$SOURCE" )" ...
2
votes
1answer
46 views

BASH Function to create the next SVN release tag.

I've created the below script and would appreciate any feedback. # svn directory ^/tags/release/ # 1/ # 2/ # 3/ # 4/ # usage: svnnextrelease fixes email formatting # generated line: svn cp ^/trunk ...
1
vote
1answer
139 views

Newbie need help with bash script for working with Android

I'm new to bash scripting and need some help improve a script i made for working with reverse engineering Android applications. I wrote comments in the script itself to explain what i want to do.. ...
2
votes
1answer
85 views

Tips on good practice in my bash script that logs in to a website, downloads a PDF, adds it to iBooks and uploads it to dropbox

I am running a scheduled script on my iPhone that logs in to a website, downloads a PDF, adds it to iBooks and uploads it to dropbox. All of this happens only when it has WiFi access. I want to make ...
3
votes
1answer
129 views

Shell script that verifies checksums when moving between filesystems

I coded this because it seemed like a fun project, would be awesome if someone reviewed this. Thanks! #! /bin/sh #function that checks if dependencies are installed check_software() { #check ...
3
votes
1answer
115 views

Bash arrays and case statements - review my script

#!/bin/bash # Change the environment in which you are currently working. # Actually, it calls the relevant 'lettus.sh' script if [ "${BASH_SOURCE[0]}" == "$0" ]; then echo "Try running this as ...
2
votes
2answers
121 views

Bash script to share snippets of code using rsync

I just got through writing a bash script so my friend and I can share snippets of code to a central file via rsync and ssh. What it does is this; Sets up ssh public key auth if not already working. ...
1
vote
3answers
463 views

Bash script to swap out, edit host files

So this is my first useful bash script. It's meant to make it easy to switch between a "work" hosts file (that blocks sites like reddit.com, youtube.com, etc.) and my normal hosts file, and also to ...
4
votes
2answers
326 views

Bash script to send to recycle bin or trash

This is a script that emulates a recycle bin in the CLI. You can undo your last changes and delete files This is my first bash script so don't hesitate to bash me. Thank you for taking a look. #! ...

1 2 3
15 30 50 per page