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

Re: bash syntax



"Eloy A. Paris" <eparis@ven.ra.rockwell.com> writes:

> Witold Grabysz <vtold@polsl.gliwice.pl> wrote:
> 
> : the following phrase doesn't work in bash:
> : ((ls);(ls))
> : Why? Is it not allowed by the shell syntax or there is a bug in it?
> 
> Yup, you're right; it's probably a bug. This does work:
> 
> ( (ls);(ls))
> 

It's not a bug but a feature.  In the bash 1.x version this syntax was
possible.  In bash 2.x ((expression)) is an evaluation of the
arithmetic expression.

Here a short excerpt from /usr/doc/bash/NEWS.gz:

  kkk. The ksh-like ((...)) arithmetic command syntax has been implemented.
       This is exactly equivalent to `let "..."'.

BTW:  Should I prefer $(( )) to (( )), which one of these is Posix?

        Torsten

-- 
I haven't lost my mind -- it's backed up on tape somewhere.
                                            Fortune Cookie
PGP Public key available


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: