Help on bash script?
Xu Qiang
Qiang.Xu at fujixerox.com
Fri Aug 12 03:26:19 GMT 2005
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
More information about the freebsd-questions
mailing list