irc-bot/firebot

22 lines
361 B
Plaintext
Raw Normal View History

2010-12-15 22:36:16 -07:00
#! /bin/sh
2011-01-06 21:08:21 -07:00
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
2010-12-15 22:36:16 -07:00