1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/bin/bash SUBCHAR=! [[ "$*" =~ $SUBCHAR ]] && WORK=$* || WORK="$* $SUBCHAR" echo -n "[botchcli] $WORK> " while read LINE; do if [ "x$LINE" == "x" ] ; then echo -n elif [ "x${LINE,,}" == "xquit" ] ; then exit 0 else ${WORK/$SUBCHAR/$LINE} fi echo -n "[botchcli] $WORK> " done