Date: Tue, 2 Jul 1996 13:25:15 -0400 (EDT) From: Rashid Karimov <rashid@rk.ios.com> To: mike@networx.ie Cc: questions@freebsd.org Subject: Re: Bug in /bin/sh Message-ID: <199607021725.NAA12316@rk.ios.com> In-Reply-To: <ECS9607021715A@networx.ie> from "Michael Ryan" at Jul 2, 96 05:20:15 pm
next in thread | previous in thread | raw e-mail | index | archive | help
it is well known that classic "sh" is buggy. It fails for example on some complex "configure" scripts ... can't recall the name of the product, I think it's something from GNU project. Use bash instead. Rashid. > Can anybody confirm that there is a bug in /bin/sh in FreeBSD v2.1, > which the following commands illustrate... > > ------------------------------------------ > $ cat > shbug > #! /bin/sh -- > f () { > echo start > test $1 = abc && { > echo middle > return 1 > } > there is no command called "there" & > echo end > return 0 > } > f $1 > exit 0 > ^D > $ chmod +x shbug > $ shbug abc > start > end > $ middle > ------------------------------------------ > > Note how the "echo end" statement got executed, eventhough it > should not have? Also, it doesn't complain about the command > "there" not being found. > > It's the "&" at the end of the "there" command that seems to > confuse the shell. Remove it and the script works as you'd > expect. > > Please email any replies to me directly (as well as to the > list if you like), as I'm not on the mailing list right now. > > > Thanks, > Mike > <mike@NetworX.ie> > --- > > > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607021725.NAA12316>