<html>
<body>
<pre>
<tt>
#!/bin/sh
# Plan 9 style diff
diff=/usr/bin/diff
while :
do
case "$1" in
-*)
opts="$opts$1 "
shift
;;
*)
break
;;
esac
done
case $# in
2)
if [ -d "$1" -a -f "$2" ]
then
set "$1/`basename \"$2\"`" "$2"
elif [ -f "$1" -a -d "$2" ]
then
set "$1" "$2/`basename \"$1\"`"
fi
exec $diff $opts "$1" "$2"
;;
*)
exec $diff $opts ${1+"$@"}
;;
esac
</tt>
</pre>
<HR>
© 1998,
Boyd Roberts:
<A HREF="mailto:[email protected]">[email protected]</A>
</body>
</html>
|