I am new to scripting
Can anyone help me with what is wrong with my below script. I am getting an error.
if `tail -2 jeevagan/sample/logs.txt | head -1 | grep "Start Outputing Report"` = TRUE && `tail -1 jeevagan/sample/logs.txt | grep "Start Outputing Report"` = TRUE
then
echo "report error"
else
echo "report good"
fi
In the logs file, i have logs such as below:
2016-04-07 06:57:36,248 INFO : Finished Outputing Report:, Format:EXCEL, Locale: en_IN
2016-04-07 07:06:52,812 INFO : Start Outputing Report:, Format:EXCEL, Locale: en_IN
2016-04-07 06:52:56,451 INFO : Finished Outputing Report:, Format:EXCEL, Locale: en_IN
2016-04-07 06:52:56,451 INFO : Finished Outputing Report:, Format:EXCEL, Locale: en_IN
2016-04-07 07:06:52,812 INFO : Start Outputing Report:, Format:EXCEL, Locale: en_IN
2016-04-07 07:06:52,812 INFO : Start Outputing Report:, Format:EXCEL, Locale: en_IN
2016-04-07 07:06:52,812 INFO : Start Outputing Report:, Format:EXCEL, Locale: en_IN