Hi
I wrote a script to compare files. Everything works fine, but I want the script to warn me when any file missing, then I get error on this line, I don't understand the messages. Could someone figure them out for me please, and how to fix it. Thanks
Here are the error messages:
Total M_*_18052001 are 41
Total M1705* are 10
/ARCHIVES/monitorFiles/compareFiles.ksh[54]: 41: cannot open
/ARCHIVES/monitorFiles/compareFiles.ksh[57]: 10: cannot open
Here is the code:
......
total1=`ls -l $source_file1|wc -l`
echo "Total $source_file1 are $total1"
total2=`ls -l $source_file2|wc -l`
echo "Total $source_file2 are $total2"
# The following lines give me errors above
if $total1 < 41; then
echo "File is missing" ;
fi
if $total2 < 10; then
echo "File is missing" ;
fi
.......
I run this script under ksh shell
Thanks
I wrote a script to compare files. Everything works fine, but I want the script to warn me when any file missing, then I get error on this line, I don't understand the messages. Could someone figure them out for me please, and how to fix it. Thanks
Here are the error messages:
Total M_*_18052001 are 41
Total M1705* are 10
/ARCHIVES/monitorFiles/compareFiles.ksh[54]: 41: cannot open
/ARCHIVES/monitorFiles/compareFiles.ksh[57]: 10: cannot open
Here is the code:
......
total1=`ls -l $source_file1|wc -l`
echo "Total $source_file1 are $total1"
total2=`ls -l $source_file2|wc -l`
echo "Total $source_file2 are $total2"
# The following lines give me errors above
if $total1 < 41; then
echo "File is missing" ;
fi
if $total2 < 10; then
echo "File is missing" ;
fi
.......
I run this script under ksh shell
Thanks