On Wed, Feb 20, 2002 at 10:07:31PM +1100, getadog wrote:
> On Wed, Feb 20, 2002 at 07:06:53PM +1100, Grant Parnell wrote:
> > #!/bin/bash
[...]
> >         LET COUNT=$COUNT+1
[...]

> Not sure what LET does, either,  perhaps COUNT=$(( $COUNT + 1 ))

bash-2.03$ help let
let: let arg [arg ...]
    Each ARG is an arithmetic expression to be evaluated.  Evaluation
    is done in long integers with no check for overflow, though division
    by 0 is trapped and flagged as an error.  The following list of
    operators is grouped into levels of equal-precedence operators.
    The levels are listed in order of decreasing precedence.

        -, +            unary minus, plus
        !, ~            logical and bitwise negation
        *, /, %         multiplication, division, remainder
        +, -            addition, subtraction
        <<, >>          left and right bitwise shifts
        <=, >=, <, >    comparison
        ==, !=          equality, inequality
        &               bitwise AND
        ^               bitwise XOR
        |               bitwise OR
        &&              logical AND
        ||              logical OR
        expr ? expr : expr
                        conditional expression
        =, *=, /=, %=,
        +=, -=, <<=, >>=,
        &=, ^=, |=      assignment

    Shell variables are allowed as operands.  The name of the variable
    is replaced by its value (coerced to a long integer) within
    an expression.  The variable need not have its integer attribute
    turned on to be used in an expression.

    Operators are evaluated in order of precedence.  Sub-expressions in
    parentheses are evaluated first and may override the precedence
    rules above.

    If the last ARG evaluates to 0, let returns 1; 0 is returned
    otherwise.


  Scott
-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to