« Return to Thread: bash doubt

Re: bash doubt

by Todd A. Jacobs :: Rate this Message:

Reply to Author | View in Thread

On Wed, May 14, 2008 at 06:21:07AM +0530, L.V.Gandhi wrote:

>                 i=$i+1

This syntax is broken. Any of these alternatives will work:

    - let i=$i+1
    - let i+=1
    - i=$(( i + 1 ))

Basically, you need to let bash know that $i is an integer, and not a
string.

--
"Oh, look: rocks!"
        -- Doctor Who, "Destiny of the Daleks"


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...

 « Return to Thread: bash doubt