Hi i'm new to the forum and was hoping someone could help me with the following query.
I do alot of testing and have hundreds of log files output. I have a script (someone else wrote) which finds all the passed and failed logs and puts a number in a column onto a webpage:
e.g:
Pass Fail Total
---- ---- -----
Win32:
Vista: 8 0 8
XP: 1 3 4
The code basically runs as a bash script on a linux box with apache and displays it on a browser.
for the failed files it displays the file info. Which basically greps the last 2 lines of the file and if it has failed it displays info from the line:
tail -n 2 *.log | grep -v FAILED | grep FAIL
above log file grep produces:
***-TESTv3.00g-XYZ-01-TEST_RESULT-1-FAIL 10/08/2010,00:24:43 (q:\runfiles\vlist.ini)
output on the browser is below:
Client INI File Time Failed At test Version
XYZ-01 q:\runfiles\myfiles\win32\vlist.ini 10/08/2010,00:24:43 TESTv3.00g
Now the problem i have is i haven't got enough info to find the log.
Is there a way i can get grep to also get the file name for the failed files.
so maybe a condition:
if the above tail command produced failed results then display the filename?