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

Re: OT: merge two files



On Sat, Aug 21, 2004 at 09:42:15AM -0500, Kent West wrote:
> I want to merge the contents of one file with the bottom X lines of 
> another. This works:
> 
> cat file1 > EndResultFile && tail +20 file2 >> EndResultFile
> 
> Is this adequate, or is there a better way to do it?

Well I don't know if it's "better" but you could do it in less
characters if you use a command group, ie

(cat file1 && tail +20 file2) > EndResultFile

Also doesn't "+20" give you line 20 and everything after it? So for 
"the bottom X lines" you would want "-n X" or simply "-X".

-- 
Nicholas Lativy
http://homepage.ntlworld.com/lativy

Attachment: signature.asc
Description: Digital signature


Reply to: