I am using a grep command with two patterns in my KSH script. File has line breaks in it and both the patterns are in different lines. Here is the command - grep -l 'RITE AID.*ST.820' natriter820u.20140914
Pattern1 - RITE AID
Pattern2 - ST*820
I am not getting any results from this, whereas if I replace this file with a different file having no line breaks then it works. Is there any work around to deal with line breaks here.
Here is the sample data:-
ISA*00* 00 *ZZ*NATIONSBANK *14*0030020520500 *140918*1200*U*00401*000006436*0*P*^
GS*RA*014578892*IGIHCJEEJ*20140918*1200*6442*X*004010
ST*820*000006482
N1*PR*RITE AID HDQTRS. CORP.*1*014578892
Can someone please help.
Thanks