From 6f7f17f793e3f999dab1535ebd387bdb7a9a38e4 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 16 Dec 2018 13:08:36 +0000 Subject: 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@ --- bin/ksh/ksh.1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bin/ksh/ksh.1') diff --git a/bin/ksh/ksh.1 b/bin/ksh/ksh.1 index 5dcefe1d456..3db9a930947 100644 --- a/bin/ksh/ksh.1 +++ b/bin/ksh/ksh.1 @@ -1,8 +1,8 @@ -.\" $OpenBSD: ksh.1,v 1.201 2018/06/18 17:03:58 millert Exp $ +.\" $OpenBSD: ksh.1,v 1.202 2018/12/16 13:08:35 schwarze Exp $ .\" .\" Public Domain .\" -.Dd $Mdocdate: June 18 2018 $ +.Dd $Mdocdate: December 16 2018 $ .Dt KSH 1 .Os .Sh NAME @@ -540,7 +540,7 @@ if no .Ar list is executed, the exit status is zero. .It Xo Ic for Ar name -.Oo Cm in Ar word No ... Oc ; +.Op Cm in Op Ar word ... ; .Cm do Ar list ; Cm done .Xc For each @@ -564,10 +564,10 @@ e.g.\& The exit status of a .Ic for statement is the last exit status of -.Ar list ; -if +.Ar list . +If there are no items, .Ar list -is never executed, the exit status is zero. +is not executed and the exit status is zero. .It Xo Ic if Ar list ; .Cm then Ar list ; .Oo Cm elif Ar list ; -- cgit v1.2.3