Hello,
I wrote a script and part of the script, I have a validation to check if the file has <EOF> on the last line of the
file. If it does not have a <EOF>, then a message has to be written to a log file.
the code snippet shown below works fine, but it writes the below message if the <EOF> is not available.
PHP Code:
if [ `tail -1 $FILE` = "<EOF>" ]
then echo "<EOF> tag is available in the $FILE" >>${errfile} 2>&1
else "<EOF> tag missing in $FILE" >>${errfile} 2>&1
./File_avail_cp.sh[82]: <EOF> tag missing in SALES_20111223: not found [No such file or directory]. I don't understand why I get message
-
not found [No such file or directory].
If a file contains <EOF> then it works fine. error message is:
<EOF> tag is available in the ORDER_20111223
Can someone please help me resolve this?
thanks!