repl.it
@zleap/

bashmenu.sh

Bash

example on menu choices

fork
loading
Files
  • main.sh
main.sh
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
OPTIONS="HELLO QUIT"
select opt in $OPTIONS; do
    if [ "$opt" = "QUIT" ] ; then
        echo done
    elif [ "$opt" = "HELLO" ] ; then
        echo "Hello, World"
    else
        #clear
        echo "bad option"
     fi
done
?