'Van Handel' djvh2@comcast.net [sed-users]
2017-05-23 00:16:30 UTC
Hello. This is on Linux. I have a command that returns many
attributes for each set top box on a headend, but I only need the
MacAddr, HubId, and Model.
To get that info, I pipe the output to grep & sed like this to leave only
the text I care about:
output | egrep "Mac Address|Hub Id|Model" | sed "s/^.*[ ]//"
That gives me vertical output like below (many more lines than this):
00:12:34:56:78:9A
101
123456
00:21:CE:54:22:7A
101
876543
00:21:32:43:54:87
1
234
I would like to combine this output 3 lines at a time, like:
00:12:34:56:78:9A 101 123456
00:21:CE:54:22:7A 101 876543
00:21:32:43:54:87 1 234
Is there a way to do this using sed?
Thanks,
Dave
[Non-text portions of this message have been removed]
attributes for each set top box on a headend, but I only need the
MacAddr, HubId, and Model.
To get that info, I pipe the output to grep & sed like this to leave only
the text I care about:
output | egrep "Mac Address|Hub Id|Model" | sed "s/^.*[ ]//"
That gives me vertical output like below (many more lines than this):
00:12:34:56:78:9A
101
123456
00:21:CE:54:22:7A
101
876543
00:21:32:43:54:87
1
234
I would like to combine this output 3 lines at a time, like:
00:12:34:56:78:9A 101 123456
00:21:CE:54:22:7A 101 876543
00:21:32:43:54:87 1 234
Is there a way to do this using sed?
Thanks,
Dave
[Non-text portions of this message have been removed]