commit 01bcf9f98223e08ec51a34bec5977110ddd94814 parent 9fe5a6216669a8f32c9bb6375b396db88961f7d8 Author: rsc <devnull@localhost> Date: Sun, 30 Jan 2005 16:28:53 +0000 respect sysname Diffstat:
M | bin/awd | | | 29 | ++++++++++++++++++++++++++++- |
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/bin/awd b/bin/awd @@ -1,3 +1,30 @@ #!/bin/sh -label `pwd` +usage() { + echo 'usage: awd [label]' 1>&2 + exit 1 +} +case $# in +1) + case "$1" in + -*) + usage + ;; + esac + sys=$1 + ;; +0) + sys=`hostname` + ;; +*) + usage +esac + +p="`pwd`" +case "$p" in +*/) + label $p-$sys + ;; +*) + label $p/-$sys +esac