Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!panews.awdpa.ibm.com!ibmpa.awdpa.ibm.com!marc From: marc@ibmpa.awdpa.ibm.com (Marc Pawliger) Newsgroups: comp.unix.questions Subject: sh -ce Message-ID: <1991Feb13.104647@ibmpa.awdpa.ibm.com> Date: 13 Feb 91 18:46:47 GMT Sender: news@ibmpa.awdpa.ibm.com (news id) Reply-To: marc@ibmpa.awdpa.ibm.com (Marc Pawliger) Organization: IBM Advanced Workstations Division, Palo Alto Lines: 20 The man page for sh and ksh say the -e flag causes immediate exit if a command fails. Does this also apply for builtins? And what about the exit status? I have seen vastly differing behavior for the following: /bin/sh -ce 'cd nonexistantdirectory; pwd' Some Bourne shells exit after the bad cd with status 0, some exit with status 1. Some don't exit after the bad cd, presumably because it's a builtin. /bin/sh -ce '/bin/ls nonexistantdirectory; pwd' always exited after the ls with status 1. Please also reply by mail if you are following-up in this group... +--Marc Pawliger----IBM Advanced Workstations Division----Palo Alto, CA---+ | Internet: marc@ibminet.awdpa.ibm.com VNET: MARCP at AUSVM6 | | UUCP: uunet!ibminet.awdpa.ibm.com!marc Phone: (415) 855-3493 | +-----IBMinet: marc@ibmpa.awdpa.ibm.com----------IBM T/L: 465-3493------+ As always, these are my opinions and not IBM's etc etc etc