bug-gnu-utils
[Top][All Lists]
Advanced

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

paste documentation immprovment


From: Dan Jacobson
Subject: paste documentation immprovment
Date: 11 Apr 2002 02:05:44 +0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Gee, I sure wish the GNU paste documentation mentioned a little of this.
Wonder where she learned all this.  Wasn't from Info.

From: laura fairhead (address@hidden)
Subject: Re: print line 1 of each file, line 2 of each file...
Newsgroups: comp.unix.shell

On 07 Apr 2002 23:30:53 +0800, Dan Jacobson <address@hidden> wrote:

>How do I print
>
>Line 1 of file A
>Line 1 of file B
>Line 1 of file C
>
>Line 2 of file A
>Line 2 of file B
>Line 2 of file C
>...?
>
>Currently I use
>paste -d X A B C|awk '{gsub("X","\n");print;print ""}'
>but I feel like a jerk.

You can use the special deliminator \n to make each line
seperated by a newline, then as your last file just use
the NUL device so that an extra newline gets appended;

paste -d '\n' A B C /dev/null

Other useful standard special deliminators in the 'paste'
command are \t and \0.
-- 
http://jidanni.org/ Taiwan(04)25854780



reply via email to

[Prev in Thread] Current Thread [Next in Thread]