Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Thank you, Your solution works, what if I need to put that in a shell script? grep -v "\<Swap" instruments.log | awk '{ idx=index($0, "MasterId="); masterId=substr($0, idx+length("MasterId=")+1); masterId=substr(masterId,1,index(masterId,"L")-3); print masterId; } ' | while read line; do grep "$line" rel.log done It is giving me syntax error: unexpected end of file Commented Jan 31, 2012 at 23:44
  • 1
    There's a simpler and faster way: use a multiline pattern. Commented Feb 1, 2012 at 0:09