select
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 in ; do echo $; done
- Create a menu from the output of another command:
select in $(); do echo $; done
- Specify the prompt string for
selectand create a menu for picking a file or folder from the current directory:
PS3=""; select in *; do echo $; done
- Create a menu from a Bash array:
=(); select in $}; do echo $; done
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
