bug-bash
[Top][All Lists]
Advanced

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

Re: help for needs to mention for ((...))


From: Lawrence Velázquez
Subject: Re: help for needs to mention for ((...))
Date: Sun, 19 Sep 2021 17:06:05 -0400
User-agent: Cyrus-JMAP/3.5.0-alpha0-1291-gc66fc0a3a2-fm-20210913.001-gc66fc0a3

On Sun, Sep 19, 2021, at 3:25 PM, 積丹尼 Dan Jacobson wrote:
> $ help for
> only mentions
>        for name [ [ in [ word ... ] ] ; ] do list ; done
> and needs to be updated to mention
>        for (( expr1 ; expr2 ; expr3 )) ; do list ; done

Not particularly intuitive, but:

bash-5.1$ help 'for (('
for ((: for (( exp1; exp2; exp3 )); do COMMANDS; done
    Arithmetic for loop.
    
    Equivalent to
        (( EXP1 ))
        while (( EXP2 )); do
                COMMANDS
                (( EXP3 ))
        done
    EXP1, EXP2, and EXP3 are arithmetic expressions.  If any expression is
    omitted, it behaves as if it evaluates to 1.
    
    Exit Status:
    Returns the status of the last command executed.

-- 
vq



reply via email to

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