Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!milano!bigtex!james From: james@bigtex.cactus.org (James Van Artsdalen) Newsgroups: gnu.bash.bug Subject: ksh's trap "" ERR Message-ID: <18026@bigtex.cactus.org> Date: 13 Jun 89 17:51:14 GMT Organization: Institute of Applied Cosmology, Austin TX Lines: 26 On feature I miss from ksh is 'trap "" ERR'. For example, my .ksh file has trap 'echo "(ERR:$?)"' ERR I tried to simulate this in bash with PROMPT_COMMAND, but it didn't work. Here's an emacs M-x shell script: it starts out in ksh, and then runs bash. /tmp> (exit 1) (ERR:1) /tmp> /usr/local/src/dist-bash/bash /tmp> PROMPT_COMMAND='if [ $? -ne 0 ] ; then echo "(ERR:$?)" ; fi' PPROMPT_COMMAND='if [ $? -ne 0 ] ; then echo "(ERR:$?)" ; fi' /tmp> /tmp> (exit 1) ((exit 1) /tmp> bash doesn't print the error status. Also note that bash doesn't behave well under emacs, but I assume this is related to previous reported bugs with determining interactive status. -- James R. Van Artsdalen james@bigtex.cactus.org "Live Free or Die" Dell Computer Co 9505 Arboretum Blvd Austin TX 78759 512-338-8789