I have scripts that change directory in a push pop bash kind of way etc. Now, if a wrong parameter value is given whenn calling a script, one of the script commands may fail causing the script to abort before doing the final cd pop, leaving the pwd in the wrong dir. This means the user has to cd back to the proper dir. Anyway, it would be good to have some mechanism, like catch blocks, or finalize, or on error resume, within a script, to tidy up before returning to the caller.
Thank you, Darren.
Log in to post a comment.