I'm writing a script that functions as a "talking terminal" (you type in commands and it says the output) and so far my code is:
#!/bin/bash
while [ 1=1 ]; do
echo -n "~>"
read COMMAND
espeak "$($COMMAND)"
done
and it works for simple commands:
bash$ ./talkingterminal.sh
~> ls
# espeak says "talkingterminal.sh"
but when I use pipes etc:
bash$ ./talkingterminal.sh
~>ip addr | grep inet
Command "|" is unknown, try "ip addr help".
~>
and that command works in bash and gives the expected output. any help? thanks, Martin