howto join lines

Chris Tyler chris at tylers.info
Wed Oct 1 15:48:43 UTC 2008


On Wed, 2008-10-01 at 17:13 +0200, David Hláčik wrote:
> Hello guys,
> 
> i want to have those lines joined to one line with spaces
> 
> Before :
> 
> textone
> texttwo
> something
> 
> After :
> 
> textone texttwo something
> 
> So far i have been using fmt -w 2000 , but this is limited to 2000
> characters. There must be something better.

Hi David,

It's unclear if you want to do this interactively or from the command
line, and whether you want to affect all lines or just selected ones. If
you want to put all of the lines in a file onto one, you could use:

  tr "\012" " "     # convert newlines to spaces

-Chris





More information about the fedora-list mailing list