Oct 7, 2003 #1 chomps303 MIS Joined Sep 30, 2003 Messages 83 Location US How can I get sed to tell me what the line number is for a specific line? ie: file abc = aaaaaaaaaa bbbbbbbbbb cccccccccc search for bbbbb and return line 2 Thanks Brandt
How can I get sed to tell me what the line number is for a specific line? ie: file abc = aaaaaaaaaa bbbbbbbbbb cccccccccc search for bbbbb and return line 2 Thanks Brandt
Oct 7, 2003 #2 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR Try something like this: Code: awk '/bbbbb/{printf "%d\n",NR}' abc Hope This Help PH. Upvote 0 Downvote