Skip to main content
1 of 4
Azalix
  • 13
  • 1
  • 4

Bash script question - skip enter key press

I just started out with linux and bash script and here is a portion of my scrypt:

...

read main_menu

case "$main_menu" in

    "0" )   exit
            ;;
    "1" )   cp /etc/bamt/cgminer.conf.X11 /etc/bamt/cgminer.conf;
            sudo mine restart;
            ;;

...

The question is how can I make it so after the user enters 0 or 1, 2 etc, he doesn't have to press the enter key, so practically you enter the number and it directly jumps to the next menu or function without the enter key press.

Thank you!

Azalix
  • 13
  • 1
  • 4