On Fri, 12 Aug 2005, Xu Qiang wrote:

> This is my test script:
>
> ---------------------
> #!/bin/bash
>
> var=0
> var=$[3]
>
> vari=0
> ++vari
>
> echo $var
> echo $vari
> ---------------------
>
> The result is:
> ./test.sh: ++vari: command not found
> 3
> 0
>
> So the manual of bash is incorrect?
>
> Regards,
> Xu Qiang

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))
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to