Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh add a note to Short-Circuit operators section about t...



details:   https://anonhg.NetBSD.org/src/rev/f1a3af9c581e
branches:  trunk
changeset: 556588:f1a3af9c581e
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Dec 21 08:40:29 2003 +0000

description:
add a note to Short-Circuit operators section about the somewhat
nonintuitive evaluation in case there is both || and && specified
pointed out in bin/23814 by VaX#n8

diffstat:

 bin/sh/sh.1 |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 0cabf29a540c -r f1a3af9c581e bin/sh/sh.1
--- a/bin/sh/sh.1       Sun Dec 21 08:32:39 2003 +0000
+++ b/bin/sh/sh.1       Sun Dec 21 08:40:29 2003 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sh.1,v 1.72 2003/12/18 15:52:31 heas Exp $
+.\"    $NetBSD: sh.1,v 1.73 2003/12/21 08:40:29 jdolecek Exp $
 .\" Copyright (c) 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
@@ -31,7 +31,7 @@
 .\"
 .\"    @(#)sh.1        8.6 (Berkeley) 5/4/95
 .\"
-.Dd November 14, 2003
+.Dd December 21, 2003
 .Os
 .Dt SH 1
 .Sh NAME
@@ -660,6 +660,9 @@
 and
 .Dq ||
 both have the same priority.
+Note that these operators are left-associative, so
+.Dq true || echo bar && echo baz
+and nothing else.  This is not the way it works in C.
 .Ss Flow-Control Constructs -- if, while, for, case
 The syntax of the if command is
 .Bd -literal -offset indent



Home | Main Index | Thread Index | Old Index