Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add command output after number of existing lines

Status
Not open for further replies.

UsRb

IS-IT--Management
Mar 19, 2007
48
HR

If my first command output is 5 lines:
lpar1,1024,2048
lpar2,1024,2048
lpar3,2048,4096
lpar4,2048,8192
lpar5,512,1024

Now I execute second command which gives me another 5 lines
1,2,3
2,3,4
3,4,5
4,5,6
5,6,7

I want to add second command's output so it will all be in one line, like this:

lpar1,1024,2048,1,2,3
lpar2,1024,2048,2,3,4
lpar3,2048,4096,3,4,5
lpar4,2048,8192,4,5,6
lpar5,512,1024,5,6,7

How is this possible to do?
Thanx
 
man paste

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You could try something like:
- capture the output from the first command to a file in /tmp
- capture the output from the second command to a file in /tmp
- use the paste command (perhaps with -d',') to "join" them together


I hope that helps.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top