Sample Header Ad - 728x90

Exiting a shell script with nested loops

13 votes
5 answers
25683 views
I have a shell script with nested loops and just found out that "exit" doesn't really exit the script, but only the current loop. Is there another way to completely exit the script on a certain error condition? I don't want to use "set -e", because there are acceptable errors and it would require too much rewriting. Right now, I am using kill to manually kill the process, but it seems there should be a better way to do this.
Asked by user923487 (303 rep)
Jun 30, 2015, 03:37 PM
Last activity: Apr 10, 2024, 10:48 PM