Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!swrinde!ucsd!rutgers!deejay!gear!am!alex From: alex@am.sublink.org (Alex Martelli) Newsgroups: comp.unix.questions Subject: Re: Listing files bet. two specified dates Message-ID: <1990Oct27.085732.336@am.sublink.org> Date: 27 Oct 90 08:57:32 GMT References: <9220005@hpldsla.sid.hp.com> <2162@sixhub.UUCP> <1990Oct24.181321.23205@dg-rtp.dg.com> Organization: Premiata Famiglia Martelli & Figli Lines: 21 In <1990Oct24.181321.23205@dg-rtp.dg.com> rice@dg-rtp.dg.com (Brian Rice) writes: ... >find $1 -mtime -$2 -print > /tmp/mbetween.$$ >find $1 -mtime -$3 -print >> /tmp/mbetween.$$ >sort /tmp/mbetween.$$ > /tmp/mbetween2.$$ >uniq -u /tmp/mbetween2.$$ >rm -f /tmp/mbetween.$$ /tmp/mbetween2.$$ I don't see how this can work as is (to follow this approach, you'd have to place the sorted outputs of the two find's into two separate files, then use comm on these files, etc), and anyway this is simpler: find $1 -mtime +$2 -mtime -$3 -print since '+$2' means 'MORE than $2 days ago' just as '-$3' means 'LESS than $3 days ago'. Anyway, I agree that the date arithmetic's harder. -- Alex Martelli - (home snailmail:) v. Barontini 27, 40138 Bologna, ITALIA Email: (work:) staff@cadlab.sublink.org, (home:) alex@am.sublink.org Phone: (work:) ++39 (51) 371099, (home:) ++39 (51) 250434;