Comparing modified times of files

Art Neilson art at pilikia.pegasus.com
Mon Mar 11 07:28:54 AEST 1991


In article <SCOTTP.91Mar8093523 at bwdlh504.bnr.ca> scottp at bwdlh504.bnr.ca (Scott Pace) writes:
>I would like to be able to compare two files' time stamps, to see which one
>is the oldest (or newest). How can I do this with sh?
>I know about ksh and perl, but I want to know how it can be done with plain
>old Bourne Shell.
>I am running on HP-UX, if that makes a difference.
>--
>Scott Pace, Bell Northern Research, Ottawa, Canada, (613) 765-2631
>scottp at bnr.ca

How about:

:
echo `ls -t $* | head -1`
-- 
Arthur W. Neilson III		| INET: art at pilikia.pegasus.com
Bank of Hawaii Tech Support	| UUCP: uunet!ucsd!nosc!pilikia!art



More information about the Comp.unix.shell mailing list