> Hi
> I would like to convert a list, such as:
> item1
> item2
> item3
> ...
> itemN
> Into this:
> item1 item2 item3 ... itemN
> (please note there is a white space between the strings)
> I am currently doing the conversion using ^J in vi, but I'm sure there is an
> easier and quicker way to do it say in sed/awk/ksh ?
What is the source of the list? A file? A variable? Command output?
Whichever it is, there are many ways of doing it (not to mention UUOC).
A file:
echo `cat FILE`
tr "\n" " " < FILE
A variable:
echo $VAR
Command output:
echo `command`
--
Chris F.A. Johnson http://cfaj.freeshell.org
===================================================================
My code (if any) in this post is copyright 2001, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License