I ran a for loop with several commands over different files in shell under nohup. I need to get the log values of one of the commands which gets printed on the terminal (in this case, in the nohup.out file). I tried to do an egrep and find the pattern. Though, I got my log values, I do not know it belongs to which file. I want to print the file name along with the values. Is there a way to do so ? Any help would be appreciated. Thanks in advance.
My nohup.out file looks like
100000 GFF lines processed. 200000 GFF lines processed. 300000 GFF lines processed. 400000 GFF lines processed. 500000 GFF lines processed. 600000 GFF lines processed. 700000 GFF lines processed. . . . about 10000 lines . . . __no_feature XXXX __ambiguous 102723 __too_low_aQual 0 __not_aligned 0 . . . .
This goes on for several different files. I want to extract the four lines which has "__no_feature" etc with their input file names.
I used egrep :
egrep "__no_feature|__ambiguous|__too_low_aQual|__not_aligned|__alignment_not_unique" nohup.out
But I got only the patterns and not the file names.