Subject: bin/17514: /bin/sh `set -e' does not exit on command not found
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dbj@netbsd.org>
List: netbsd-bugs
Date: 07/07/2002 22:22:40
>Number: 17514
>Category: bin
>Synopsis: /bin/sh `set -e' does not exit on command not found
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jul 07 19:23:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Darrin B. Jewell
>Release: NetBSD 1.6_BETA2 via cvs ~20020616T2139Z on netbsd-1-6 branch
>Organization:
>Environment:
System: NetBSD quiteria 1.6_BETA2 NetBSD 1.6_BETA2 (QUITERIA) #13: Thu Jun 20 17:05:07 EDT 2002 dbj@quiteria:/usr/src/sys/arch/macppc/compile/QUITERIA macppc
Architecture: powerpc
Machine: macppc
>Description:
A /bin/sh script that uses `set -e' does not exit
when it cannot find a command in my path.
the testme1.sh case below works incorrectly
but the testme2.sh case below with an absolute
path works as I expect.
Notice also that the error reporting style is
different between the two.
>How-To-Repeat:
$ sh ./testme1.sh
this_command_should_not_be_found: not found
Should not still be running
$ cat ./testme1.sh
#!/bin/sh
set -e
this_command_should_not_be_found
echo "Should not still be running"
$ sh ./testme2.sh
./testme2.sh: /this_command_should_not_be_found: not found
$ cat ./testme2.sh
#!/bin/sh
set -e
/this_command_should_not_be_found
echo "Should not still be running"
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: