]> diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/miscellany/tools/CMP
Always check that mktemp()/mktemp2() succeeds before trying to
[nmh] / docs / historical / mh-6.8.5 / miscellany / tools / CMP
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