mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-12-23 23:17:23 +02:00
24 lines
340 B
Bash
Executable File
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
|