howto join lines

Les Mikesell lesmikesell at gmail.com
Wed Oct 1 19:40:33 UTC 2008


Patrick O'Callaghan wrote:
>
>>>> i want to have those lines joined to one line with
>>> spaces
>>>> Before :
>>>>
>>>> textone
>>>> texttwo
>>>> something
>>>>
>>>> After :
>>>>
>>>> textone texttwo something
>>>>

>> the good old command line "cat" was invented (I am told) to concatenate!
> 
> 'cat' will not remove newlines.

Not by itself, but its a reasonable thing to run in backticks so the 
shell will do it for you:

echo `cat multi_line_file`
or
echo $(cat multi_line_file`)
if you prefer that syntax.

-- 
   Les Mikesell
    lesmikesell at gmail.com





More information about the fedora-list mailing list