2
votes
1answer
148 views

How to have a bash script perform a specific action on errors of _each_ command?

Similarly to set -e performs an exit on "uncaught" $? != 0, I'd like to have this event trigger the execution of another command, e.g. a logger call. How can this be done?
0
votes
1answer
677 views

ksh - map Ctrl-D to exit shell

I would like to know how we can map the keys Ctrl-D in ksh to exit the shell as it does in bash shell. Not much familiar with key binding in ksh. Edit My comments are after the <!-- string ...
3
votes
3answers
943 views

What does exit do in an if block in a shell script?

I have a question regarding unix shell script. Say if you do exit 1 in inner if: will it exit or will it still execute the outer if? The following is a dummy example. if [ "$PASSWORD" == ...