Re: How to sort by date in descending order

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

 



Dave Cross wrote:
> On 26 February 2010 13:40, Roberto Ragusa <mail@xxxxxxxxxxxxxxxx> wrote:
>> Richard Cahilig wrote:

>>> Your help is very much appreciated. Thanks.
>> while read a b; do s1=`date --date "$b" +%s`; echo $s1 $a $b;done <yourfile.txt | sort -nr
> 
> Very nice. Just one small addition - pass the output through cut to
> get back to the original data format:
> 
> while read a b; do s1=`date --date "$b" +%s`; echo $s1 $a $b;done
> <yourfile.txt | sort -nr | cut -f 2- -d ' '

I left that as an exercise for the reader ;-)

-- 
   Roberto Ragusa    mail at robertoragusa.it
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux