[Techtalk] copy file headers...

Jenn Vesperman jenn at anthill.echidna.id.au
Sat May 18 00:58:58 EST 2002


On Fri, 2002-05-17 at 23:31, Walt wrote:
> Is there any way to copy _x_ number of lines
> from the header of one file over the header of
> another file?

I'm assuming that you know piping and sequencing enough to construct a
script or a command once I give you a pointer.

1. Use 'head' to grab x lines from file 1.
2. Use 'tail' to grab from line x to end of file 2.
3. Use 'cat' or '>>' or some such to prepend the results of step 1 to
the results of step 2.

There may be a semi-documented feature of head or tail that makes this
even easier.


Jenn V.
-- 
    "Do you ever wonder if there's a whole section of geek culture 
        	you miss out on by being a geek?" - Dancer.

jenn at anthill.echidna.id.au     http://anthill.echidna.id.au/~jenn/





More information about the Techtalk mailing list