I want to check the result of a job and execute an action on FAILED
.
First: I grep the last word of the line in my application logfile (for the recent processed file ($processedfilename
)):
check1=$(grep "$processedfilename" "$logfile" | grep "anotherword" | \
grep "FAILED" | tail -1 | awk '{print $NF}')
This results in [FAILED]
.
Now I want to check on the result
if [ $check1 -eq "[[FAILED]" ]
then
or
if [ $check1 -eq "\[FAILED]" ]
then
There's always arithmetic syntax error.
What's the correct syntax to check on [FAILED]
?