home *** CD-ROM | disk | FTP | other *** search
- From: fritz@mercury.caltech.edu (Fritz Nordby)
- Newsgroups: comp.unix.questions,alt.sources
- Subject: Re: how to compare file modification time (whole dir tree?)
- Message-ID: <1990Aug2.195056.4041@laguna.ccsf.caltech.edu>
- Date: 2 Aug 90 19:50:56 GMT
-
-
- Am I missing something here, or will the
- following provide the desired function:
-
- #!/bin/sh
- case $# in 2);;*)echo "usage: ${0:-newer} file1 file2" >&2;exit 2;;esac
- [ ! -f "$2" -o -f "$1" -a "X`/bin/ls -t \"\$1\" \"\$2\"`" = "X$1
- $2"] >/dev/null 2>&1
-
-
- I suppose this will fail if, for example, it is invoked as
- $ newer 'foo
- foo' 'foo'
- but people who put newlines in their filenames get what they deserve!
-