On Wed, May 14, 2008 at 3:05 AM, Jordi GutiƩrrez Hermoso <[EMAIL PROTECTED]>
wrote:

> On 13/05/2008, L. V. Gandhi <[EMAIL PROTECTED]> wrote:
> > I have a script as follows
> [snip]
> >                 i=$i+1
> [snip]
> >  How to correct it
>
> Your counter is wrong. $i + 1 means to treat i as a string and to
> append the string "1" to it. If you want to do arithmetic in bash, you
> have to put it inside brackets. i = $[i+1].


You should use i=$((i+1))

In man bash:
 The old format $[expression] is deprecated and will be removed in upcoming
versions of bash.

Reply via email to