bug-bash
[Top][All Lists]
Advanced

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

Minor documentation suggestion: while/until


From: address@hidden
Subject: Minor documentation suggestion: while/until
Date: Mon, 20 Dec 2010 15:23:50 -0700

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2
-Wall
uname output: Linux jsh-green-netbook 2.6.35-24-generic #42-Ubuntu SMP Thu
Dec 2 01:41:57 UTC 2010 i686 GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 4.1
Patch Level: 5
Release Status: release

Description:
Documentation nit: "list" overloaded in while/until description.

Repeat-By:

Here's the bash(1) man page section for while/until:

while list; do list; done
 until list; do list; done
      The while command continuously executes the do list as long as the
last command in  list
      returns  an  exit  status of zero.  The until command is identical to
the while command,
      except that the test is negated; the do list is executed as long as
the last command  in
      list returns a non-zero exit status.  The exit status of the while and
until commands is
      the exit status of the last do list command executed, or zero if none
was executed.


Fix:

If you changed them to something like this:

while listA; do listB; done
 until listA; do listB; done
      The while command continuously executes listB as long as the last
command in listA
      returns  an  exit  status of zero.  The until command is identical to
the while command,
      except that the test is negated; listB is executed as long as the last
command in
      listA returns a non-zero exit status.  The exit status of the while
and until commands is
      the exit status of the last command executed in listB, or zero if none
was executed.

I think they'd be easier to read.

-- 
Jeffrey Haemer <jeffrey.haemer@gmail.com>
720-837-8908 [cell], http://seejeffrun.blogspot.com [blog],
http://www.youtube.com/user/goyishekop [vlog]
פרייהייט? דאס איז יאַנג דינען וואָרט.
*
*


reply via email to

[Prev in Thread] Current Thread [Next in Thread]