Forum Thread: Requested Help on My Bash Script Please!

Okay, so first of all, here is the Pastebin link.

I'm not sure why it is stopping the script completely after I type any number and press enter. For example, the title pops up, I press the indicated number for the program I wish to use then press enter. But when it should run nmap or hping, it just simply quits and goes back to the default terminal.

Join the Next Reality AR Community

Get the latest in AR — delivered straight to your inbox.

5 Responses

Have you tried running bash -x to see the debugging output?

Using PS3 works:

PS3='Enter a number:'
options=("nmap" "hping" "exit")
select opt in "${options@}"
case $opt in
"nmap" )

"hping" )

"exit" )
exit 0 ;;


It then tells me

"./ line 86: ${options@}: bad substitution" and I'm not for sure how to fix that. Also, thank you for your reply!

EDIT: Okay, so I have kindof fixed it. I deleted the @ character, and it worked, only shows one option. and that's nmap. (option 1) and if I choose another number (i.e. 2) it just exits.

Ah - sorry, there are brackets in there that were apparently removed by the WonderHowTo auto-formatting. It should be:


Ahhhhh, thank you so much! This helped me out a bunch!

Share Your Thoughts

  • Hot
  • Active