|
![](/i/fill.gif) |
>> Exception handling is not an OOP feature. And yes, bash /does/ have it:
>>
>> set -e trap "echo aborted by user || kill -INT $$" INT trap "echo
>> aborted by other process || kill -TERM $$" TERM trap "echo error
>> reported" EXIT
>>
>> ... critical section ...
>>
>> set +e trap - INT trap - TERM trap - EXIT
>
> Interesting, I didn't know that. Thanks!
It's truly terrifying just how much stuff you /can/ do with Bash.
(At this point I must remind you that just because you /can/ does NOT,
in any way, imply that you /should/!!)
Post a reply to this message
|
![](/i/fill.gif) |