Hi,

You can also do this in sed, which I use when I need speed:

(sed "s/^/file1*/" file1;sed "s/^/file2*/" file2)|sort -t* -k2

Cheers,
Andre



Date: Wed, 20 Jun 2007 13:33:21 +1000
From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Subject: RE: [U2] Unix cat help

Stewart Leicester wrote:

> perl -lne 'print "$ARGV*$_"' file1 file2 | sort -t* -k2,99
> newfile

Or just do it in awk:

awk '{printf("%s*%s\n",FILENAME,$0)}' file1 file2 | sort -t*
- -k2,999

Gotta say I was surprised that the '*' delimeter in the sort
command didn't need to be escaped with \, but it doesn't.

-- The shell will expand the * if it's on its own, but this will only
match files starting with -t (that would probably have been created by a
typo :-)

Cheers,

Ken

Important Notice: This email is subject to important restrictions,
qualifications and disclaimers ("the Disclaimer") that must be accessed
and read at the following address or by copying and pasting the following
address into your Internet browser's address bar: 
http://www.frstia.co.za/Disclaimer.asp

The Disclaimer is deemed to form part of the content
of this email in terms of Section 11 of the Electronic Communications
and Transactions Act, 25 of 2002. If you cannot access the Disclaimer,
please obtain a copy thereof from us by sending an email to mailto:[EMAIL 
PROTECTED]

FirstRand STI Admin (Pty) Ltd is an Authorised Financial Services Provider
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to