mirror of https://github.com/CrimsonTome/tldr.git
select: update page (#12325)
* select: update page --------- Co-authored-by: Vitor Henrique <87824454+vitorhcl@users.noreply.github.com> Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com> Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>pull/23/head
parent
e334f1e0da
commit
56d77e0f72
|
@ -7,9 +7,13 @@
|
||||||
|
|
||||||
`select {{word}} in {{apple}} {{orange}} {{pear}} {{banana}}; do echo ${{word}}; done`
|
`select {{word}} in {{apple}} {{orange}} {{pear}} {{banana}}; do echo ${{word}}; done`
|
||||||
|
|
||||||
- Create a menu for picking a file or folder from the current directory:
|
- Create a menu from the output of another command:
|
||||||
|
|
||||||
`select {{file}} in *; do echo ${{file}}; done`
|
`select {{line}} in $({{command}}); do echo ${{line}}; done`
|
||||||
|
|
||||||
|
- Specify the prompt string for `select` and create a menu for picking a file or folder from the current directory:
|
||||||
|
|
||||||
|
`PS3="{{Select a file: }}"; select {{file}} in *; do echo ${{file}}; done`
|
||||||
|
|
||||||
- Create a menu from a Bash array:
|
- Create a menu from a Bash array:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue