Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Aug 2005 11:29:04 +0800
From:      Xu Qiang <Qiang.Xu@fujixerox.com>
To:        dpk <dpk@dpk.net>, Xu Qiang <Qiang.Xu@fujixerox.com>
Cc:        Giorgos Keramidas <keramida@ceid.upatras.gr>, freebsd-questions@freebsd.org
Subject:   RE: Help on bash script?
Message-ID:  <20050812032531.6FC8E1D9A6@imss.sgp.fujixerox.com>

next in thread | raw e-mail | index | archive | help
dpk wrote:
> It will work with either 'let' or within an 'arithmetic expansion':
> =

> $[++var]
> let ++var
> =

> By the way, there is another syntax, from the man page, that seems to
> operate identically:
> =

> $((++var)) and $((var+1))

With "let ++var", the result is still 0, it isn't incremented. With $[++var=
], the result is "0: command not found".
"$((++var))" is to the same effect as "let ++var". =


$((var+1)) works. But the value of var can't be incremented. =


thanks, =

Xu Qiang





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050812032531.6FC8E1D9A6>