Loops in Unix seem to be the bane of my life. Can someone put me out of my misery and tell me what I am doing wrong in the code below. As I cannot get it to fail and exit the loop
ls $CTM_FTPIN | grep trigger | grep > filelist
while [ -s $filelist ]; do
do some coding here
nawk -v mnem=$mnem -v runopt=$run_opt -v batch=$batch_id -f aftn3220.awk filelist > filelist2 - this one line off the filelist
mv filelist2 filelist - replace the original file
done
What am I doing wrong here as I cannot get the loop to fil when the file is empty
Thanks
Bob
ls $CTM_FTPIN | grep trigger | grep > filelist
while [ -s $filelist ]; do
do some coding here
nawk -v mnem=$mnem -v runopt=$run_opt -v batch=$batch_id -f aftn3220.awk filelist > filelist2 - this one line off the filelist
mv filelist2 filelist - replace the original file
done
What am I doing wrong here as I cannot get the loop to fil when the file is empty
Thanks
Bob