Scenario:
I need to validate and move all the files in a directory. I need help in selecting each file.
So far I have this
.
FILECOUNT=`ls $INPUTDIR | wc -l`
while [ $FILECOUNT -gt 0 ]
do
<select file>
<validate file>
if valid
move file to valid_dir
else
move file to error_dir
fi
FILECOUNT=`expr $FILECOUNT - 1`
done
.
Basically I need some help in selecting each file, is there a way to select the file that appears alphabetically first in a listing?
I need to validate and move all the files in a directory. I need help in selecting each file.
So far I have this
.
FILECOUNT=`ls $INPUTDIR | wc -l`
while [ $FILECOUNT -gt 0 ]
do
<select file>
<validate file>
if valid
move file to valid_dir
else
move file to error_dir
fi
FILECOUNT=`expr $FILECOUNT - 1`
done
.
Basically I need some help in selecting each file, is there a way to select the file that appears alphabetically first in a listing?