views:

337

answers:

1

In bourne shell I have the following:

VALUES=`some command that returns multiple line values`

echo $VALUES

Looks like:

"ONE"
"TWO"
"THREE"
"FOUR"

I would like it to look like:

"ONE" "TWO" "THREE" "FOUR"

Can anyone help?

+2  A: 

echo $VALUES | tr '\n' ' '

eliah
worked like a charm, thanks eliah
Chris Kannon
Nice. Just a tweak: in bash and zsh at least you can pipe in the env var without echo with <<<, i.e. tr '\n' ' ' <<< $VALUES.
liwp