Re: [ fbsd_chat ] sh(1) docs [ was: Bourne shell short-circuit operators improperly documented ]

2009-07-28 Thread Oliver Fromme
spellberg_robert email...@emailrob.com wrote: my killer_app, -- a priori --, depends upon the use of a good general_purpose macro_processor [b]. i thought that i had found one in m4(1), Personally I think m4 is weird and error-prone. Another possibility is to use cpp (the C

Re: Bourne shell short-circuit operators improperly documented

2009-07-19 Thread Christian Weisgerber
Brett Glass br...@lariat.net wrote: As I understand it, when it comes to UNIX result codes, 0 doesn't really mean true -- it means no error. (In other words, it means false.) Whereas any nonzero value means there was an error (and indicates what kind). In other words, it means that it's

Re: Bourne shell short-circuit operators improperly documented

2009-07-18 Thread Paul Schenkeveld
On Sat, Jul 18, 2009 at 03:48:35AM +0100, Adrian Wontroba wrote: No wonder I don't use short circuit operators much. When zero equals one, it gets rather confusing. I agree that they can be confusing. Forget the 0 and 1, just think of success and failure. It's also confusing that they

Re: Bourne shell short-circuit operators improperly documented

2009-07-18 Thread Oliver Fromme
Actually I've never regarded and || (and also | and ) as operators, like real operators in a programming language, but as command separators, much like ;, but with special semantics. Note that foo bar baz foo || bar || baz is the same as if foo; then if bar; then baz; fi; fi if

Re: Bourne shell short-circuit operators improperly documented

2009-07-18 Thread Dag-Erling Smørgrav
Adrian Wontroba a...@stade.co.uk writes: Perhaps the syntax could have been and / or (as in Perl's and / or statement qualifiers (something() or die oops;), but it is far too late to change sh syntax. We have to live with it or use a different shell or language. Pop quiz: what are the

Re: Bourne shell short-circuit operators improperly documented

2009-07-17 Thread Jeremy C. Reed
The only problem to me is that it says AND-OR since they are not C-style logical operators. It should just say conditional execution. ___ freebsd-chat@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-chat To unsubscribe, send

Re: Bourne shell short-circuit operators improperly documented

2009-07-17 Thread Adrian Wontroba
On Fri, Jul 17, 2009 at 04:57:12PM -0600, Brett Glass wrote: Short-Circuit List Operators ``'' and ``||'' are AND-OR list operators. ``'' executes the first command, and then executes the second command if the exit status of the first command is zero. ``||'' is similar, but

Re: Bourne shell short-circuit operators improperly documented

2009-07-17 Thread Brett Glass
At 06:01 PM 7/17/2009, Adrian Wontroba wrote: No it is succinctly correct but confusing (the UNIX way?). These operators work on exit codes where 0 = success = true and and !0 = failure = false. As I understand it, when it comes to UNIX result codes, 0 doesn't really mean true -- it means no

Re: Bourne shell short-circuit operators improperly documented

2009-07-17 Thread Adrian Wontroba
On Fri, Jul 17, 2009 at 07:21:14PM -0600, Brett Glass wrote: At 06:01 PM 7/17/2009, Adrian Wontroba wrote: No it is succinctly correct but confusing (the UNIX way?). These operators work on exit codes where 0 = success = true and and !0 = failure = false. As I understand it, when it comes to