linux + file output manipulation [closed]
Clash Royale CLAN TAG#URR8PPP
up vote
-2
down vote
favorite
we have the follwing file ( could be the same line more or less )
more /tmp/info
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
how to manipulate the output so we get the follwing
expected results ( with lines indention )
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux text-processing awk sed text-formatting
closed as unclear what you're asking by ñÃÂsýù÷, Archemar, jimmij, Romeo Ninov, meuh Apr 29 at 15:27
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
 |Â
show 6 more comments
up vote
-2
down vote
favorite
we have the follwing file ( could be the same line more or less )
more /tmp/info
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
how to manipulate the output so we get the follwing
expected results ( with lines indention )
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux text-processing awk sed text-formatting
closed as unclear what you're asking by ñÃÂsýù÷, Archemar, jimmij, Romeo Ninov, meuh Apr 29 at 15:27
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
you need indention or add empty lines between? or both? and what have you tried so far?
â Ã±ÃÂsýù÷
Apr 29 at 10:02
yes we need to indent the lines
â jango
Apr 29 at 10:08
@jango, then you should describe the indentation logic: how should the 4th, 5th, 6th, 7th block be indented and you should specify the indentation size
â RomanPerekhrest
Apr 29 at 10:09
yes only 4th as linux01.sys76.com eno83122 Speed 10000Mb/s ( we can ignore : "
â jango
Apr 29 at 10:11
1
@jango, what is the problem with describing the indentation logic? why should the 3rd block not be indented?
â RomanPerekhrest
Apr 29 at 10:18
 |Â
show 6 more comments
up vote
-2
down vote
favorite
up vote
-2
down vote
favorite
we have the follwing file ( could be the same line more or less )
more /tmp/info
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
how to manipulate the output so we get the follwing
expected results ( with lines indention )
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux text-processing awk sed text-formatting
we have the follwing file ( could be the same line more or less )
more /tmp/info
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
how to manipulate the output so we get the follwing
expected results ( with lines indention )
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Speed 10000Mb/s
linux02.sys76.com eno83122 Speed 10000Mb/s
linux03.sys76.com eno83122 Speed 10000Mb/s
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Duplex Full
linux02.sys76.com eno83122 Duplex Full
linux03.sys76.com eno83122 Duplex Full
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux01.sys76.com eno83122 Link_detected yes
linux02.sys76.com eno83122 Link_detected yes
linux03.sys76.com eno83122 Link_detected yes
linux text-processing awk sed text-formatting
edited Apr 29 at 13:22
Jeff Schaller
31.1k846105
31.1k846105
asked Apr 29 at 9:54
jango
11518
11518
closed as unclear what you're asking by ñÃÂsýù÷, Archemar, jimmij, Romeo Ninov, meuh Apr 29 at 15:27
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by ñÃÂsýù÷, Archemar, jimmij, Romeo Ninov, meuh Apr 29 at 15:27
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
you need indention or add empty lines between? or both? and what have you tried so far?
â Ã±ÃÂsýù÷
Apr 29 at 10:02
yes we need to indent the lines
â jango
Apr 29 at 10:08
@jango, then you should describe the indentation logic: how should the 4th, 5th, 6th, 7th block be indented and you should specify the indentation size
â RomanPerekhrest
Apr 29 at 10:09
yes only 4th as linux01.sys76.com eno83122 Speed 10000Mb/s ( we can ignore : "
â jango
Apr 29 at 10:11
1
@jango, what is the problem with describing the indentation logic? why should the 3rd block not be indented?
â RomanPerekhrest
Apr 29 at 10:18
 |Â
show 6 more comments
you need indention or add empty lines between? or both? and what have you tried so far?
â Ã±ÃÂsýù÷
Apr 29 at 10:02
yes we need to indent the lines
â jango
Apr 29 at 10:08
@jango, then you should describe the indentation logic: how should the 4th, 5th, 6th, 7th block be indented and you should specify the indentation size
â RomanPerekhrest
Apr 29 at 10:09
yes only 4th as linux01.sys76.com eno83122 Speed 10000Mb/s ( we can ignore : "
â jango
Apr 29 at 10:11
1
@jango, what is the problem with describing the indentation logic? why should the 3rd block not be indented?
â RomanPerekhrest
Apr 29 at 10:18
you need indention or add empty lines between? or both? and what have you tried so far?
â Ã±ÃÂsýù÷
Apr 29 at 10:02
you need indention or add empty lines between? or both? and what have you tried so far?
â Ã±ÃÂsýù÷
Apr 29 at 10:02
yes we need to indent the lines
â jango
Apr 29 at 10:08
yes we need to indent the lines
â jango
Apr 29 at 10:08
@jango, then you should describe the indentation logic: how should the 4th, 5th, 6th, 7th block be indented and you should specify the indentation size
â RomanPerekhrest
Apr 29 at 10:09
@jango, then you should describe the indentation logic: how should the 4th, 5th, 6th, 7th block be indented and you should specify the indentation size
â RomanPerekhrest
Apr 29 at 10:09
yes only 4th as linux01.sys76.com eno83122 Speed 10000Mb/s ( we can ignore : "
â jango
Apr 29 at 10:11
yes only 4th as linux01.sys76.com eno83122 Speed 10000Mb/s ( we can ignore : "
â jango
Apr 29 at 10:11
1
1
@jango, what is the problem with describing the indentation logic? why should the 3rd block not be indented?
â RomanPerekhrest
Apr 29 at 10:18
@jango, what is the problem with describing the indentation logic? why should the 3rd block not be indented?
â RomanPerekhrest
Apr 29 at 10:18
 |Â
show 6 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Awk
solution:
awk 'prev && prev != $3 print ORS ORS prev = $3 1' /tmp/info
The output:
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
is it include lines indentation ?
â jango
Apr 29 at 10:09
see my update in the question
â jango
Apr 29 at 10:14
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Awk
solution:
awk 'prev && prev != $3 print ORS ORS prev = $3 1' /tmp/info
The output:
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
is it include lines indentation ?
â jango
Apr 29 at 10:09
see my update in the question
â jango
Apr 29 at 10:14
add a comment |Â
up vote
0
down vote
accepted
Awk
solution:
awk 'prev && prev != $3 print ORS ORS prev = $3 1' /tmp/info
The output:
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
is it include lines indentation ?
â jango
Apr 29 at 10:09
see my update in the question
â jango
Apr 29 at 10:14
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Awk
solution:
awk 'prev && prev != $3 print ORS ORS prev = $3 1' /tmp/info
The output:
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
Awk
solution:
awk 'prev && prev != $3 print ORS ORS prev = $3 1' /tmp/info
The output:
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Speed: 10000Mb/s
linux02.sys76.com eno83122 Speed: 10000Mb/s
linux03.sys76.com eno83122 Speed: 10000Mb/s
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Duplex: Full
linux02.sys76.com eno83122 Duplex: Full
linux03.sys76.com eno83122 Duplex: Full
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
linux01.sys76.com eno83122 Link detected: yes
linux02.sys76.com eno83122 Link detected: yes
linux03.sys76.com eno83122 Link detected: yes
answered Apr 29 at 10:03
RomanPerekhrest
22.4k12144
22.4k12144
is it include lines indentation ?
â jango
Apr 29 at 10:09
see my update in the question
â jango
Apr 29 at 10:14
add a comment |Â
is it include lines indentation ?
â jango
Apr 29 at 10:09
see my update in the question
â jango
Apr 29 at 10:14
is it include lines indentation ?
â jango
Apr 29 at 10:09
is it include lines indentation ?
â jango
Apr 29 at 10:09
see my update in the question
â jango
Apr 29 at 10:14
see my update in the question
â jango
Apr 29 at 10:14
add a comment |Â
you need indention or add empty lines between? or both? and what have you tried so far?
â Ã±ÃÂsýù÷
Apr 29 at 10:02
yes we need to indent the lines
â jango
Apr 29 at 10:08
@jango, then you should describe the indentation logic: how should the 4th, 5th, 6th, 7th block be indented and you should specify the indentation size
â RomanPerekhrest
Apr 29 at 10:09
yes only 4th as linux01.sys76.com eno83122 Speed 10000Mb/s ( we can ignore : "
â jango
Apr 29 at 10:11
1
@jango, what is the problem with describing the indentation logic? why should the 3rd block not be indented?
â RomanPerekhrest
Apr 29 at 10:18