Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jul 1996 17:20:15 BST
From:      Michael Ryan <mike@networx.ie>
To:        FreeBSD Support <questions@freebsd.org>
Subject:   Bug in /bin/sh
Message-ID:  <ECS9607021715A@networx.ie>

next in thread | raw e-mail | index | archive | help
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?ECS9607021715A>