irc-bot/firebot

25 lines
422 B
Plaintext
Raw Normal View History

2010-12-15 22:36:16 -07:00
#! /bin/sh
firebot () {
read cmd args
case $cmd in
calc)
printf "%s = " "$args"
echo "$args" | bc -l
;;
units)
src=$(printf "%s" "$args" | sed 's/ ->.*//')
dst=$(printf "%s" "$args" | sed 's/.*-> //')
2010-12-15 22:36:16 -07:00
units -1 -v -- "$src" "$dst"
;;
*)
exit 1
;;
esac
}
echo "$1" | firebot