I have a script as follows
#!/bin/bash
rm -f ~/stock/flstock.csv
grep FUTSTK ~/stock/today/$1 |grep "25/09/2008"|cut -s -d, -f9|sort -nr > temp
i=0
for trv in $(cat temp)
do
grep $trv ~/stock/today/$1 >> ~/stock/flstock.csv
i=$((i+1))
if [ $i -eq 20 ]
then
exit 0
fi
done
rm -f temp
cat ~/stock/flstock.csv |cut -s -d, -f2|sort >> ~/stock/fliquidstocks.txt
Last line is not getting executed . But if I run last line afterwards in console, it works.
Can someone throw somelight why it happens.
--
L.V.Gandhi
http://lvgandhi.tripod.com/
linux user No.205042