Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!targon!andre From: andre@targon.UUCP (andre) Newsgroups: comp.unix.questions Subject: Re: how to compare file modification time in bourne shell script Message-ID: <1431@targon.UUCP> Date: 26 Jul 90 11:16:43 GMT References: <1990Jul23.233044.2729@silma.com> Reply-To: andre@targon.UUCP (andre) Organization: Nixdorf Computer BV., DO, P.O. Box 29,Vianen, The Netherlands Lines: 24 In article <1990Jul23.233044.2729@silma.com> aab@silma.UUCP () writes: >I need to compare the modification times of two files in a bourne shell >script. I would like to do this without writing C code. >Machine is Sparcstation 1 running SunOS 4.03c >Thus I need a function: >newer file1 file2 what about if [ -n "`find file2 -newer file1 -print`" ] then echo file2 is newer else echo file2 is not newer fi -- The mail| AAA DDDD It's not the kill, but the thrill of the chase. demon...| AA AAvv vvDD DD Ketchup is a vegetable. hits!.@&| AAAAAAAvv vvDD DD {nixbur|nixtor}!adalen.via --more--| AAA AAAvvvDDDDDD Andre van Dalen, uunet!hp4nl!targon!andre