3. Pass all your files through a sed command like this: sed -i "s#[[:space:]]*//. 6. Getting down to the question: If you wrap your block in a loop, you can use break to exit early: Alternately, you can use a function, and return to exit early: Alternately, you can wrap your loop in a subshell (though this will prevent it from doing other things, like variable assignments that impact code outside the subshell, as well): Do not modify files in /usr/bin. Is there a way to go two directories back in cygwin (linux). Your shell script is a script; git is an ELF binary. # Exit status 0 returned because command executed  When a bash function ends its return value is its status: zero for success, non-zero for failure. The exit status is an integer number. Convenient to read on the go, and to keep by your desk as an ever-present companion. Type “wq”, the “w” indicates that the file should be written, or saved which will overwrite existing file and the “q” indicates that vim should quit, or exit Then press < Enter>. 0 exit status means the command was successful without any errors. 1. How do I check whether a file or file directory exist in bash? If n is omitted, the return  From man bash on return [n];. To exit the function stack without exiting shell one can use the command: kill -INT $$ As pizza stated, this is like pressing Ctrl-C, which will stop the current script from running and drop you down to the command prompt. Through awk, $ awk '$5!="99999"{sum+=$5}END{print sum}' file 227.5 Explanation: $5!="99999" if 5th column does not contain 99999, then do {sum+=$5} adding the value of 5th column to the variable sum. Use the exit statement to indicate successful or unsuccessful shell script termination. Every Linux or Unix command executed by the shell script or user has an exit status. First: Don't do any of this. On POSIX systems the standard exit code is 0 for success and any number from 1 to 255 for anything else. The value of N can be used by other commands or shell scripts to take their own action. ./