The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-04-2007
sharmagaurav_2k sharmagaurav_2k is offline
Registered User
 

Join Date: Sep 2007
Posts: 2
Thumbs down Infinite Loop in Autosys while running a shell script, Manual run is fine

Hi All,

I have a shell script, which runs fine manually, but goes into infinite loop, when run through Autosys Scheduler.
The part of code going in infinite loop is pasted below:


*************this is only a part of code*****************

i=0
while [ $i -lt $split ]
do
#echo start $start and end $end
sed -n ''$start','$end'p' $dir/$filename >> $dir/$fldr/input.csv
cat $dir/$fldr/header.csv $dir/$fldr/input.csv >> $dir/$fldr/input_`expr $i + 1`.csv
echo `date +%m%d%y_%T`--$dir/$fldr/input_`expr $i + 1`.csv created >> $log
rm -f $dir/$fldr/input.csv
start=`expr $end + 1`
if [ $i -eq `expr $split - 2` ]; then
start=`expr $end + 1`
end=`expr $filecnt`
else
end=`expr $start + $flsize - 1`
fi
#cat input_`expr $i + 1`.csv
let "i=$i+1"
done

***************************************************


in the last but one line, i am using
let"i=$i+1"

I tried using
i=`expr $i + 1`

but still the script goes in infinite loop...



Need some suggestions...
Reply With Quote
Remove advertisements
!!
!! Forum Sponsor