Plan 9 from User Space's /usr/local/plan9/bin/awd

#!/bin/sh

usage() {
	echo 'usage: awd [label]' 1>&2
	exit 1
}
case $# in
1)
	case "$1" in
	-*)
		usage
		;;
	esac
	sys=$1
	;;
0)
	# hostname -s sets the hostname to "-s" on Solaris
	sys=${sysname:-$(hostname |sed 's/\..*//')}
	;;
*)
	usage
esac

p="`pwd`"
case "$p" in
*/)
	label $p-$sys
	;;
*)
	label $p/-$sys
esac

Space Glenda

Copyright © 2005 Lucent Technologies, Russ Cox, MIT.
See license for details.