Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does it mean?

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
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 &quot;File is missing&quot; ;
fi
if $total2 < 10; then
echo &quot;File is missing&quot; ;
fi
.......


I run this script under ksh shell

Thanks
 
Hi

why don't you change the expression
if$test1 < 41 to if test $total1 < 41.... and try.

Regards
Mohan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top