In article <[EMAIL PROTECTED]>, Martin Schulze <[EMAIL PROTECTED]> wrote: >So regular *.sh scripts must not contain any "exit" statement. >(which is the case e.g. for keymap.sh)
Ah, now I remember. This has been solved quite some time ago. *.sh scripts may contain an "exit" statement, because they are run in a subshell. Fragment from /etc/init.d/rcS case "$i" in *.sh) # Source shell script for speed. ( trap - INT QUIT TSTP set start . $i ) ;; Now, an exit in a subshell [ in ()] will just exit that subshell. Proof: $ sh -c 'echo foo; ( exit ) ; echo bar' foo bar So there is no problem with exit in *.sh scripts. You can even press control-c in a sourced script, and it will only interrupt the sourced script and not /etc/init.d/rcS I've carefully thought this over, bummer that I forgot about it .. My memory's like a siefe .. (English expr?) Mike. -- "Did I ever tell you about the illusion of free will?" -- Sheriff Lucas Buck, ultimate BOFH.