I'm looking for the string SUCCESS
into the file_1
& file_2
which in this case looks for the string and prints it based on whether its there on only file_1
or on both file_1
and file_2
while I'm looking it to print only once either its on both the file of one. How that can be done?
$ grep SUCCESS file_1 file_2
Result:
file_1:Host fox_01 is SUCCESS
file_2:Host fox_02 is SUCCESS
file_2:Host fox_01 is SUCCESS
I'm open to any advice or solution, not necessarily grep.
SUCCESS
is in either file? Your question is a bit hard to understand, it would help if you gave an example of your desired output. – rusty shackleford Apr 24 '19 at 11:29