Plan 9 from Bell Labs’s /usr/web/sources/contrib/boyd/sys/src/cmd/diff.html

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


<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>
&copy 1998,
Boyd Roberts:
<A HREF="mailto:[email protected]">[email protected]</A>
</body>
</html>

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].