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

Re: paste -sd



On Sat, Dec 18, 2004 at 04:55:13PM -0500, Tong wrote:
> $ seq 10 | paste -sd "   \n"
> 1 2 3 4
> 5 6 7 8
> 9 10
> 
> >From the man page:
> 
>        -d, --delimiters=LIST
>               reuse characters from LIST instead of TABs
> 
> But I don't understand why more space in delimiter list would produce
> different results. Please explain. 

Maybe these examples will make it clear:

$ seq 10 | paste -sd "ABC"
1A2B3C4A5B6C7A8B9C10
$ seq 10 | paste -sd "ABC\n"
1A2B3C4
5A6B7C8
9A10

`paste' always uses ONE character as delimiter. When you specify more
than one character `paste' will cycle through them. In your last
example, it uses a space as the delimiter for the first three columns
and a newline for the fourth.

-- 
Maurits van Rees | http://maurits.vanrees.org/ [Dutch/Nederlands] 
Public GnuPG key: keyserver.net ID 0x1735C5C2
"Let your advance worrying become advance thinking and planning."
 - Winston Churchill

Attachment: signature.asc
Description: Digital signature


Reply to: