Quote:
Originally Posted by joeyg
You can do it simpler, but I am assuming that you might have several things to do when a non-zero is found.
This is looking for the last one line of the file; knowing that the value will be on that line.
x=$(tail -1 sqlplus.out)
echo $x
if [ $x -ne 0 ]
then
echo "You have found a non-zero value"
fi
|
Won't run in bourne, for a bourne-safe syntax, use back ticks:
Code:
if [ `tail -1 sqlplus.out` -ne 0 ] ; then echo "You have found a non-zero value" ; fi