Hello,
First of all, I'd like to say hello to all members of forum.
Can You please help me with the matter described below?
I am trying to fetch a data from the file to variable, I am doing this using below script:
returned=`tail -50 SapLogs.log | grep -i -E "Error|"`
echo $returned
Unfortunately, the $returned variable contains all 50 lines from SapLogs file. There is no filtering by "Error". Moreover, when I am executing tail -50 SapLogs.log | grep -i -E "Error|
without assigning to variable, it works perfectly.
What am I doing wrong? It could be very stupid mistake, but I am new in Bash scripting, please help.
Regards,
Adrian