• [^] # Re: Mais quelle est donc cette commande ?

    Posté par . En réponse au journal Mais quelle est donc cette commande ?. Évalué à 1.

    Par hasard :
    $ for ((i = 0; i < 5; i++)); do echo $i; done
    0
    1
    2
    3
    4

    extrait du man:
    [...]
    for (( expr1 ; expr2 ; expr3 )) ; do list ; done
    First, the arithmetic expression expr1 is evaluated according to the rules described below under ARITHMETIC EVALUATION. The arithmetic expression
    expr2 is then evaluated repeatedly until it evaluates to zero. Each time expr2 evaluates to a non-zero value, list is executed and the arithmetic
    expression expr3 is evaluated. If any expression is omitted, it behaves as if it evaluates to 1. The return value is the exit status of the last
    command in list that is executed, or false if any of the expressions is invalid.
    [...]