respect sysname
This commit is contained in:
parent
9fe5a62166
commit
01bcf9f982
1 changed files with 28 additions and 1 deletions
29
bin/awd
29
bin/awd
|
|
@ -1,3 +1,30 @@
|
||||||
#!/bin/sh
|
#!/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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue