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.

2
  • Thanks, but I did not get similar output ... wolf@linux:~$ awk -v RS='\\s+' '{print NR, $0}' file.txt 1 11:34:21.590434 IP 10.10.1.30 > 10.10.1.217: ICMP echo reply, id 27948, 2 eq 1, length 64 wolf@linux:~$ echo $SHELL /bin/bash wolf@linux:~$ Commented Jan 31, 2021 at 17:03
  • Then you copy/pasted wrong, or you aren't using gawk as the answer says is required, or your input doesn't look like the line you posted. If you use the script I posted on the input you posted using gawk as I said is required then you WILL get the output I posted. Commented Jan 31, 2021 at 17:18