Re: [exim] shouldn't exigrep sort the grepped file(names) by…

Góra strony
Delete this message
Reply to this message
Autor: Ian Eiloart
Data:  
Dla: Heiko Schlittermann, exim-users
Temat: Re: [exim] shouldn't exigrep sort the grepped file(names) by date?


--On 9 June 2010 00:05:14 +0200 Heiko Schlittermann <hs@???>
wrote:

> Hello,
>
> I think, exigrep should sort it's output by the time of the records
> (time completed? time first notice?)… While thinking about this I've
> added just a small change to have exigrep at least sort the filenames
> by the modification dates of the files.
>
> --- /usr/sbin/exigrep   2008-09-30 20:57:42.000000000 +0200
> +++ /tmp/exigrep        2010-06-09 00:02:04.000000000 +0200
> @@ -147,7 +147,7 @@

>
>  if (@ARGV)
>    {
> -  foreach (@ARGV)
> +  foreach (sort { -M $b <=> -M $a } @ARGV)
>      {
>      my $filename = $_;
>      if ($filename =~ /\.(?:gz)$/o)

>
>
> If there are no objections I'd like to ask having this change in one of
> the next exim releases.
>
> (I know, I could have sorted the files on the command line already…)


Interesting. My files are always sorted OK when grepping. Probably because
I use globs to specify them, and name them with iso dates yyyy-mm-dd, which
naturally sort properly. Still, this is a useful enhancement.

> Thank you.
>
>     Best regards from Dresden/Germany
>     Viele Grüße aus Dresden
>     Heiko Schlittermann




--
Ian Eiloart
IT Services, University of Sussex
01273-873148 x3148
For new support requests, see http://www.sussex.ac.uk/its/help/