mc-fine
09-06-2001, 01:49 PM
Hey guys I need a little help in writing some code for a shell script.
I am trying to read what is written in a text file, compare it to the result I want and if they dont match carry out a statement.
So far my code looks like this:
if (`head cron/result.txt` != "OK.")
then mail -s "PING Result: `date`"< cron/result.txt mc-fine@balh.com
fi
Unfortunately there is a problem with my condition. The error I get is:
bash: OK.: command not found
Anyone know how I can read the cron/result.txt and check if it reads "OK."?
I also tried (`head cron/result.txt` != `echo OK.`).
I am trying to read what is written in a text file, compare it to the result I want and if they dont match carry out a statement.
So far my code looks like this:
if (`head cron/result.txt` != "OK.")
then mail -s "PING Result: `date`"< cron/result.txt mc-fine@balh.com
fi
Unfortunately there is a problem with my condition. The error I get is:
bash: OK.: command not found
Anyone know how I can read the cron/result.txt and check if it reads "OK."?
I also tried (`head cron/result.txt` != `echo OK.`).