2010-12-15 22:36:16 -07:00
|
|
|
#! /bin/sh
|
|
|
|
|
2011-01-07 15:38:20 -07:00
|
|
|
exec 2>&1
|
|
|
|
|
2010-12-21 22:02:20 -07:00
|
|
|
cmd=${1%% *}
|
2011-01-06 21:08:21 -07:00
|
|
|
[ "$cmd" = "$1" ] || args=${1#* }
|
2010-12-21 22:02:20 -07:00
|
|
|
case $cmd in
|
2011-01-10 13:10:32 -07:00
|
|
|
calc)
|
2010-12-21 22:02:20 -07:00
|
|
|
printf "%s = " "$args"
|
2011-01-06 21:08:21 -07:00
|
|
|
echo "$args" | bc -l
|
2010-12-21 22:02:20 -07:00
|
|
|
;;
|
2011-01-10 13:10:32 -07:00
|
|
|
units)
|
2011-01-06 21:08:21 -07:00
|
|
|
src=$(printf "%s" "$args" | sed 's/ ->.*//')
|
|
|
|
dst=$(printf "%s" "$args" | sed 's/.*-> //')
|
2010-12-21 22:02:20 -07:00
|
|
|
units -1 -v -- "$src" "$dst"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2010-12-15 22:36:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
|