Bill Davidsen <[EMAIL PROTECTED]> wrote:
> > Dear gods. Didn't anyone tell them that $[ is deprecated?
> >
> > pos=$(($pos+1))
> >
> > ... is the preferred syntax, and is POSIX/ksh compatible.
> >
> >
> Who cares? The $(( notation is slower to type, easier to get wrong,
> gives confusing error messages if you miss the "$" and start with
> parens, etc. I know about it, but I would never use it, and it's
> visually easier to read correctly.
Two "(" are definitely _much_ faster to type than a single "[".
Both is non-portable, $[ is not POSIX AFAIK.
> If you need max portability and/or readability you use "let pos=pos+1"
> anyway.
Let is not in the shell. If you like maximum portability, use:
pos=`expr $pos + 1`
Jörg
--
EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin
[EMAIL PROTECTED] (uni)
[EMAIL PROTECTED] (work) Blog: http://schily.blogspot.com/
URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]