Skip to main content
added 5 characters in body
Source Link
GAD3R
  • 69.9k
  • 32
  • 147
  • 216

below is a script that displays a menu, when iI run it like ./menu.sh it works, but when iI run it like this: ./menu.sh | bash

iI get a lot of commands not found.

The reason iI want to run it with |bash| bash is because it will be on an ftp server and iI need to run it from different remote locations. so iI just do a curl -scurl -s to the ftp and if i do not use the |bash i| bash I just catcat a printout of the code

but for me these are just the echo commands ..... or am iI missing something

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

but for me these are just the echo commands ..... or am i missing something

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

but for me these are just the echo commands ..... or am I missing something

added 731 characters in body
Source Link
WingZero
  • 99
  • 2
  • 8

it gives me the following errors:

bash: line 3: =====: command not found
bash: line 4: 1.: command not found
bash: line 5: 2.: command not found
bash: line 6: 3.: command not found
bash: line 7: 4.: command not found
bash: line 8: 5.: command not found
bash: line 9: 6.: command not found
bash: line 10: 7.: command not found
bash: line 11: 8.: command not found
bash: line 12: 9.: command not found
bash: line 13: 10.: command not found
bash: line 14: -----------------------: command not found
bash: line 15: q.: command not found
bash: line 16: r.: command not found
bash: line 17: =======================: command not found

but for me these are just the echo commands ..... or am i missing something

it gives me the following errors:

bash: line 3: =====: command not found
bash: line 4: 1.: command not found
bash: line 5: 2.: command not found
bash: line 6: 3.: command not found
bash: line 7: 4.: command not found
bash: line 8: 5.: command not found
bash: line 9: 6.: command not found
bash: line 10: 7.: command not found
bash: line 11: 8.: command not found
bash: line 12: 9.: command not found
bash: line 13: 10.: command not found
bash: line 14: -----------------------: command not found
bash: line 15: q.: command not found
bash: line 16: r.: command not found
bash: line 17: =======================: command not found

but for me these are just the echo commands ..... or am i missing something

Source Link
WingZero
  • 99
  • 2
  • 8

menu working, but not with |bash command

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