select

Bash builtin construct for creating menus. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-select>.

Install

All systems
curl cmd.cat/select.sh
Debian Debian
apt-get install piglit
Ubuntu
apt-get install piglit
image/svg+xml Kali Linux
apt-get install piglit
Fedora
dnf install piglit
Windows (WSL2)
sudo apt-get update sudo apt-get install piglit
Raspbian
apt-get install piglit

Bash builtin construct for creating menus. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-select>.

  • Create a menu out of individual words:
    select word in apple orange pear banana; do echo $word; done
  • Create a menu for picking a file or folder from the current directory:
    select file in *; do echo $file; done
  • Create a menu from a Bash array:
    fruits=(apple orange pear banana); select word in ${fruits[@]}; do echo $word; done

© tl;dr; authors and contributors