[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash doubt



On Wed, May 14, 2008 at 8:54 AM, Todd A. Jacobs <nospam@codegnome.org> wrote:
> 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.
>
Now I changed this to
rm -f ~/lstock
i=0
for trv in $(cat temp)
do
	while [ $i -ne 20 ]
	do
		i=$[i+1]
		grep $trv stock/nsedata/2008/05/20080512.txt >> lstock
	done
done	
I get lstock only 0 byte file.
Where am I wrong

-- 
L.V.Gandhi
http://lvgandhi.tripod.com/
linux user No.205042


Reply to: