in reply to Re: Finding Oldest File in a Directory
in thread Finding Oldest File in a Directory
or converted to a one liner in perl...ls -t *BOT* | head -1
perl -e 'my %bot; for ( sort { ( $bot{ $a } ||= ( -M $a ) ) <=> ( $bot +{ $b } ||= ( -M $b ) ) } glob "\*BOT\*" ) { print "$_\n"; last; }'
-M
Free your mind
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Finding Oldest File in a Directory
by Perl Mouse (Chaplain) on Oct 06, 2005 at 09:30 UTC | |
by Moron (Curate) on Oct 06, 2005 at 09:47 UTC | |
by Perl Mouse (Chaplain) on Oct 06, 2005 at 09:52 UTC | |
by Moron (Curate) on Oct 06, 2005 at 10:12 UTC | |
by Aristotle (Chancellor) on Oct 08, 2005 at 19:29 UTC | |
|