This is my log file.
"hello1" , "hello2", "hello3" , "hello4" , "hello5"
"hello1" , "hello6", "hello7" , "hello8" , "hello9"
"hello1" , "hello12", "hello13" , "hello14" , "hello15"
"hello1" , "hello22", "hello23" , "hello24" , "hello25"
"hello2" & "hello3" are the string which I will know in advance before the log is generated.
My output should contain "hello1"
---------- Post updated at 04:25 PM ---------- Previous update was at 04:22 PM ----------
I actually figured it out.
Here it is.
Quote:
export sk=`cat /web/abcd.log | grep -P "hello2" | grep -P "hello3" | awk -F, '{print $1}'`
grep $sk /web/abcd.log