ref: 7888f0d7ab5dbd4f0a92cef3730590a4c7b9bea8
dir: /bin/vol/
#!/bin/rc -e rfork e fn usage {>[1=2] echo 'usage:' $usage && exit 'usage'} usage='vol [-+] | [+-]vol | vol' fn expr { op=$2 switch($op){ case [-+][0-9]* echo $1 $op | bc case - + echo $1 $op $step | bc case * echo $2 } } if(~ $#* 0) usage step=5 vol=`{awk '/master/ {print $2, $3}' </dev/volume} switch($#*){ case 1 vol=(`{expr $vol(1) $1}) case 2 vol=(`{expr $vol(1) $1} `{expr $vol(2) $2}) } echo master $vol echo master $vol >/dev/volume