summaryrefslogtreecommitdiff
path: root/botchcli
blob: 0d630b264e1ceea1d2fbcae983dfeeb530a07bc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

SUBCHAR=!
CMDNO=1

[[ "$*" =~ $SUBCHAR ]] && WORK=$* || WORK="$* $SUBCHAR"

echo -n "[botchcli ${CMDNO}] $WORK> "
while read LINE; do
  if [ "x$LINE" == "x" ] ; then
    echo -n
  elif [ "x${LINE,,}" == "xquit" ] ; then
    exit 0
  else
    ${WORK/$SUBCHAR/$LINE}
  fi
  CMDNO=$((${CMDNO} + 1))
  echo -n "[botchcli ${CMDNO}] $WORK> "
done