Path: utzoo!news-server.csri.toronto.edu!rutgers!usc!elroy.jpl.nasa.gov!decwrl!ucbvax!dog.ee.lbl.gov!nosc!humu!pilikia!art From: art@pilikia.pegasus.com (Art Neilson) Newsgroups: comp.unix.shell,bnr.general Subject: Re: Comparing modified times of files Message-ID: <1991Mar10.212854.3183@pilikia.pegasus.com> Date: 10 Mar 91 21:28:54 GMT References: Distribution: comp Organization: Pilikia, Honolulu Lines: 17 In article scottp@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@bnr.ca How about: : echo `ls -t $* | head -1` -- Arthur W. Neilson III | INET: art@pilikia.pegasus.com Bank of Hawaii Tech Support | UUCP: uunet!ucsd!nosc!pilikia!art