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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command line joining multiple lines.

Status
Not open for further replies.

jprabaker

Technical User
May 31, 2001
185
0
0
GB
Hi,

I need a simple one liner to join lines taken from standard input so I can store this into a variable. Tried a few things but can't get exactly what I need. Any suggestions?\

Thanks,
 
What about this ?
tr '\n' ' '

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That doesnt work unfortunately, just comes back blank. If I remove the space and run:

lsvg | tr '\n' ''

It comes back with 3 lines... But tr '\n' ' ' returns nothing


Thanks
John
 
What about this ?
Code:
lsvg | tr '\n' ' '

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top