below is a script that displays a menu, when i run it like ./menu.sh it works, but when i run it like this: ./menu.sh | bash
i get a lot of commands not found.
The reason i want to run it with |bash is because it will be on an ftp server and i need to run it from different remote locations. so i just do a curl -s to the ftp and if i do not use the |bash i just cat a printout of the code
#!/bin/bash
#$path=./
while :
do
echo " "
echo " "
echo "===== MAIN - MENU ====="
echo "1. Run old sanity script"
echo "2. Asterisk"
echo "3. Audio"
echo "4. CoCo"
echo "5. Database"
echo "6. Mobile"
echo "7. SSH"
echo "8. Touch"
echo "9. VDS"
echo "10. Wireshark"
echo -----------------------
echo "q. Quit"
echo "r. Reload"
echo "======================="
echo -n "Please enter your choice: "
read opt;
echo " "
echo " "
case $opt in
1) curl -s sanity_check.sh | bash;;
2) exec ./menu/asterisk/menu.sh;;
3) exec ./menu/audio/menu.sh;;
4) exec ./menu/coco/menu.sh;;
5) exec ./menu/database/menu.sh;;
6) exec ./menu/mobile/menu.sh;;
7) exec ./menu/ssh/menu.sh;;
8) exec ./menu/touch/menu.sh;;
9) exec ./menu/vds/menu.sh;;
10) exec ./menu/wireshark/menu.sh;;
q) echo " "
echo "Bye Bye";
exit 1;;
Q) echo " "
echo "Bye Bye";
exit 1;;
r) exec ./menu.sh;;
R) exec ./menu.sh;;
*) echo "$opt is an invaild option.";
echo "Press [enter] key to continue. . .";
read enterKey;;
esac
done