The following command gives me a list of matching expressions:
grep -f /tmp/list Filename* > /tmp/output
The list
file is then parsed and used to search Filename*
for the parsed string. The results are then saved to output
.
How would I output the parsed string from list
in the case where there is no match in Filename*?
Contents of the list
file could be:
ABC
BLA
ZZZ
HJK
Example Files:
Filename1:5,ABC,123
Filename2:5,ZZZ,342
Result of Running Command:
BLA
HJK
Stack overflow question 2480584 looks like it may be relevant, through the use of an if statement. However I'm not sure how to output the parsed string to the output file. Would require some type of read line?
TIA,
Mic