Re: bash manual/info lacks examples
Says Mike:
> bash shells can do:
>
> let a=$b+$c*$d
> let a=($b+$c)*$d
>
> but if you want to ensure compatibility with Bourne shells like
> ash, you should stick to:
>
> a=$(($b+$c*$d))
> a=$((($b+$c)*$d))
but if you want to ensure compatibility with Bourne shells like
the Bourne shell :), you should stick to
a=`expr $b + $c \* $d`
a=`expr \( $b + $c \) \* $d`
to complicate things, the spaces in the expression after `expr' are
required.
HTH,
Eric
--
E.L. Meijer (tgakem@chem.tue.nl)
Eindhoven Univ. of Technology
Lab. for Catalysis and Inorg. Chem. (SKA)
Reply to: