Date: Thu, 28 Jun 2001 19:09:16 -0700 From: Dave Tweten <tweten@nas.nasa.gov> To: freebsd-doc@freebsd.org Subject: Fw: Re: Bourne Shell Syntax Wierdness Message-ID: <200106290209.f5T29Hu01819@gilmore.nas.nasa.gov>
next in thread | raw e-mail | index | archive | help
------- Forwarded Message Date: Fri, 29 Jun 2001 03:03:44 +0100 (BST) From: "Jonathan M. Slivko" <jslivko@jslivko.org> To: Dave Tweten <tweten@nas.nasa.gov> Subject: Re: Bourne Shell Syntax Wierdness Dave, You might want to send an e-mail to freebsd-doc@freebsd.org and ask them if that's an error. If so, whats the correct syntax? -- Jonathan /--------------------------------------------------------------\ Jonathan Slivko -- Black Lotus Comm. -- jslivko@jslivko.org www.jslivko.org - www.blacklotus.net - www.freebsd.org Phone: (212) 663-1109 -- Pager: (917) 388-5304 FreeBSD: The Power to Serve! \--------------------------------------------------------------/ On Thu, 28 Jun 2001, Dave Tweten wrote: > The sh man page says that the two operators "||" and "&&" have the same > precedence. It also says that > > a || b > > means "execute b if a terminates abnormally" and > > a && b > > means "execute b if a terminates normally." > > So I don't understand why > > true || true && echo Oops! > > prints "Oops!" > > This is apparently not a bug in FreeBSD sh, because IRIX, IRIX64, and SunOS > Bourne/Korn shells work the same way, but it certainly runs counter to my > ability to read English and the contents of the man page. > > Incidently, > > true || { true && echo Oops! } > > prints nothing -- which I would have expected with or without the "{}". > > Can anybody explain this? Can that explanation go into the sh man page? > Thank you for any help you can provide -- from someone who expects to see a > large, hurried, white rabbit at any minute now. > -- > M/S 258-5 | 1024-bit PGP fingerprint: | tweten@nas.nasa.gov > NASA Ames Research Center | 41 B0 89 0A 8F 94 6C 59 | (650) 604-4416 > Moffett Field, CA 94035-1000 | 7C 80 10 20 25 C7 2F E6 | FAX: (650) 604-4377 > We each earn what freedom of speech we defend for those who most offend us. > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > ------- End of Forwarded Message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106290209.f5T29Hu01819>