wernermisc/mlt/wpan-ipv4/pex

24 lines
340 B
Bash
Executable File

#!/bin/sh
in=$1
prompt="${1##*/}"
prompt="${prompt%.*}"
shift
{
read c
while read c; do
if [ "${c#!}" != "$c" ]; then
eval "${c#!}" </dev/tty
continue
fi
if [ "${c#:}" = "$c" ]; then
cmd=$c
else
c=${c#:}
read cmd
fi
echo -e -n "$prompt> \033[1m$c\033[m "
read x </dev/tty
eval "$cmd" </dev/tty
done
} <$in