Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#315 Add catch blocks or similar to scripts.

open
nobody
None
5
2013-02-10
2012-01-07
Darren
No

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.

Discussion