Results 1 to 5 of 5
Hi there,
suppose I have a line that looks like this:
Code:
13:47:54.830735 192.168.168.65.54487 85.214.141.246.80: 336
and I want it to look like that:
Code:
13:47:54 192.168.168.65 85.214.141.246 336
The ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-02-2011 #1Just Joined!
- Join Date
- Feb 2011
- Posts
- 4
little help with bash line formatting needed
Hi there,
suppose I have a line that looks like this:
and I want it to look like that:Code:13:47:54.830735 192.168.168.65.54487 85.214.141.246.80: 336
The first line is already the output of a long expression with a lot of piping and formatting with awk etc., but now I'm somehow stuck with the rest. Can you give me a clue how to achieve it? Thanks for your help!Code:13:47:54 192.168.168.65 85.214.141.246 336
PS: The command that outputs the lines looks like that at the moment:
Code:tcpdump -n | grep 192.168.168. | grep -v "length 0" | grep length | awk '{print $1,$3,$5,$(NF)}'
- 02-02-2011 #2
sed 's/\.[0-9]\{1,6\}[ :]\{1,2\}/ /g' file
Last edited by Kloschüssel; 02-02-2011 at 01:14 PM.
- 02-02-2011 #3Just Joined!
- Join Date
- Feb 2011
- Posts
- 4
It works perfectly
Thanks, that was fast!
Cheers, Rob
- 02-03-2011 #4Linux Newbie
- Join Date
- Apr 2010
- Location
- Novosibirsk, Russia
- Posts
- 136
Advanced Bash Scripting Guide
I suppose it would be helpful to you in such cases )
- 02-03-2011 #5
+1 Schmidt
Please try to learn something out of my example and close the thread if you believe your question was answered.


Reply With Quote
