Re: howto join lines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2008-10-01 at 14:40 -0500, Les Mikesell wrote:
> 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`)

Or to avoid the fork & exec:

    echo $(<multi_line_file)

-Chris

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux