Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Mar 1998 20:24:24 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        dancy@franz.com, Studded@dal.net
Cc:        freebsd-bugs@FreeBSD.ORG, freebsd-gnats-submit@FreeBSD.ORG
Subject:   Re: bin/6047: bash does not handle -e option properly
Message-ID:  <199803180924.UAA32209@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>	What are you actually trying to accomplish here?

He's trying to to get sh fixed to work properly.  Perhaps a better
example:

---
#!/bin/sh
set -e
funcfalse() {
	return 1
}

for i in /usr/bin/false false funcfalse
do
	if $i; then echo $i; else echo not $i; fi
done
---

This handles funcfalse different from the other falses.  /bin/sh apparently
exits for `return 1' when -e is set.  The correctness of this for a POSIX
shhell depends on whether `return' is a simple command.  I don't think it
is.  This examples shows why it shouldn't be.

The PR should not mention bash in its subject line.  bash works right,
but /bin/sh doesn't.

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803180924.UAA32209>