diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-12-16 13:08:36 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-12-16 13:08:36 +0000 |
commit | 6f7f17f793e3f999dab1535ebd387bdb7a9a38e4 (patch) | |
tree | 29fe2442a0e78156aafed4a64e7dc85d832fcf89 /bin/ksh/sh.1 | |
parent | 8fe0f5c7714d89cb93df8184c9483e2887975abe (diff) |
Tweak the syntax displays to show that the list of words
in "for name in [word ...]; do list; done" can be empty.
In sh(1), clarify what happens in that case.
In ksh(1), clarify how it can happen that the list is never executed.
OK jmc@ tb@
Diffstat (limited to 'bin/ksh/sh.1')
-rw-r--r-- | bin/ksh/sh.1 | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/ksh/sh.1 b/bin/ksh/sh.1 index 76b09be882b..4f537230311 100644 --- a/bin/ksh/sh.1 +++ b/bin/ksh/sh.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sh.1,v 1.150 2018/11/30 08:55:57 solene Exp $ +.\" $OpenBSD: sh.1,v 1.151 2018/12/16 13:08:35 schwarze Exp $ .\" .\" Copyright (c) 2015 Jason McIntyre <jmc@openbsd.org> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 30 2018 $ +.Dd $Mdocdate: December 16 2018 $ .Dt SH 1 .Os .Sh NAME @@ -1755,7 +1755,7 @@ A executes a series of commands for each item in a list. Its format is: .Bd -unfilled -offset indent -.No for Ar name Op in Ar word ... +.No for Ar name Op in Op Ar word ... do .No " " Ar command .No " " Ar ... @@ -1773,8 +1773,10 @@ The construct .Qq in word ... can be omitted, which is equivalent to: in \&"$@\&". -The exit status is zero if there are no items -or otherwise the exit status of the last command executed. +The exit status is that of the last command executed. +If there are no items, +.Ar command +is not executed and the exit status is zero. .Pp A .Em while loop |