mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-11-23 03:33:08 +02:00
24 lines
340 B
Plaintext
24 lines
340 B
Plaintext
|
#!/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
|