irc-bot/firebot

24 lines
279 B
Bash
Executable File

#! /bin/sh
cmd=${1%% *}
args=${1#* }
case $cmd in
calc)
printf "%s = " "$args"
printf "%s\n" "$args" | bc -l
;;
units)
src=${args% ->*}
dst=${args#*-> }
units -1 -v -- "$src" "$dst"
;;
*)
exit 1
;;
esac