mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
31 lines
317 B
Bash
Executable file
31 lines
317 B
Bash
Executable file
#!/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
|