Comparing modified times of files

Stuart Poulin stuart at amc-gw.amc.com
Sat Mar 23 03:08:04 AEST 1991


In article <930001 at mjm.mjm.com> mjf at mjm.mjm.com (Mark Fresolone) writes:
>
>	ls -t file1 file2 | line	# returns newest
>	ls -rt file1 file2 | line	# returns oldest
>
>Mark Fresolone
>Melillo Consulting/MJM Software
>908-873-0075/Fax 908-873-2250
>mjf at mjm.com, rutgers!mjm!mjf


Or if you don't have "line":
    ls -t file1 file2 | (read XX; echo $XX)     # returns newest
    ls -rt file1 file2 |  (read XX; echo $XX)   # returns oldest

stuart at amc.com



More information about the Comp.unix.shell mailing list