mirror of https://github.com/nealey/irc-bot
24 lines
370 B
Plaintext
24 lines
370 B
Plaintext
|
#! /bin/sh
|
||
|
|
||
|
exec 2>&1
|
||
|
|
||
|
cmd=${1%% *}
|
||
|
[ "$cmd" = "$1" ] || args=${1#* }
|
||
|
case $cmd in
|
||
|
calc)
|
||
|
printf "%s = " "$args"
|
||
|
echo "$args" | bc -l
|
||
|
;;
|
||
|
units)
|
||
|
src=$(printf "%s" "$args" | sed 's/ ->.*//')
|
||
|
dst=$(printf "%s" "$args" | sed 's/.*-> //')
|
||
|
units -1 -v -- "$src" "$dst"
|
||
|
;;
|
||
|
*)
|
||
|
exit 1
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
|
||
|
|