Mercurial > hg > Applications > mh
annotate miscellany/tools/CMP @ 0:bce86c4163a3
Initial revision
author | kono |
---|---|
date | Mon, 18 Apr 2005 23:46:02 +0900 |
parents | |
children |
rev | line source |
---|---|
0 | 1 : run this through /bin/sh |
2 | |
3 case $# in | |
4 2) ;; | |
5 *) echo "usage: CMP dir1 dir2" 1>&2; exit 1 ;; | |
6 esac | |
7 | |
8 for A in `hier -a echo $2 | sed -e s%$2%%` | |
9 do | |
10 if [ ! -d $1$A ]; | |
11 then | |
12 if [ -f $1$A ]; | |
13 then | |
14 if cmp -s $2$A $1$A; | |
15 then | |
16 true | |
17 else | |
18 echo $1$A: different | |
19 fi | |
20 else | |
21 echo $1$A: non-existent | |
22 fi | |
23 fi | |
24 done |