From owner-freebsd-bugs Tue Mar 17 17:10:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA13483 for freebsd-bugs-outgoing; Tue, 17 Mar 1998 17:10:04 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA13461; Tue, 17 Mar 1998 17:10:02 -0800 (PST) (envelope-from gnats) Received: (from nobody@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA13084; Tue, 17 Mar 1998 17:04:26 -0800 (PST) (envelope-from nobody) Message-Id: <199803180104.RAA13084@hub.freebsd.org> Date: Tue, 17 Mar 1998 17:04:26 -0800 (PST) From: dancy@franz.com To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: bin/6047: bash does not handle -e option properly Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 6047 >Category: bin >Synopsis: bash does not handle -e option properly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Mar 17 17:10:01 PST 1998 >Last-Modified: >Originator: Ahmon Dancy >Organization: Franz Inc. >Release: 3.0-971225-SNAP >Environment: FreeBSD news2.franz.com 3.0-971225-SNAP FreeBSD 3.0-971225-SNAP #0: Mon Feb 23 08:20:57 PST 1998 root@news2.franz.com:/usr/src/sys/compile/NEWS i386 >Description: The following shell script does not work as it should: #!/bin/sh set -e is_net_dir_p() { case $1 in /net/*) return 0 ;; *) return 1 ;; esac } if is_net_dir_p freebsd; then echo okay fi echo done --- A properly working /bin/sh would print 'done' and exit. Currently nothing is printed and the shell silently exits. The man page for 'sh' says: -e errexit If not interactive, exit immediately if any untested command fails. The exit status of a command is considered to be explic- itly tested if the command is used to control an if, elif, while, or until; or if the command is the left hand operand of an ``&&'' or ``||'' operator. >How-To-Repeat: Run my script above. >Fix: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message