mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-22 17:51:25 +00:00
Update cheatsheets
This commit is contained in:
33
linux/whiptail
Normal file
33
linux/whiptail
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# whiptail
|
||||
|
||||
> Display text-based dialog boxes from shell scripts.
|
||||
> More information: <https://manned.org/whiptail>.
|
||||
|
||||
- Display a simple message:
|
||||
|
||||
`whiptail --title "{{title}}" --msgbox "{{message}}" {{height_in_chars}} {{width_in_chars}}`
|
||||
|
||||
- Display a boolean choice, returning the result through the exit code:
|
||||
|
||||
`whiptail --title "{{title}}" --yesno "{{message}}" {{height_in_chars}} {{width_in_chars}}`
|
||||
|
||||
- Customise the text on the yes/no buttons:
|
||||
|
||||
`whiptail --title "{{title}}" --yes-button "{{text}}" --no-button "{{text}}" --yesno "{{message}}" {{height_in_chars}} {{width_in_chars}}`
|
||||
|
||||
- Display a text input box:
|
||||
|
||||
`{{result_variable_name}}="$(whiptail --title "{{title}}" --inputbox "{{message}}" {{height_in_chars}} {{width_in_chars}} {{default_text}} 3>&1 1>&2 2>&3)"`
|
||||
|
||||
- Display a password input box:
|
||||
|
||||
`{{result_variable_name}}="$(whiptail --title "{{title}}" --passwordbox "{{message}}" {{height_in_chars}} {{width_in_chars}} 3>&1 1>&2 2>&3)"`
|
||||
|
||||
- Display a multiple-choice menu:
|
||||
|
||||
`{{result_variable_name}}=$(whiptail --title "{{title}}" --menu "{{message}}" {{height_in_chars}} {{width_in_chars}} {{menu_display_height}} "{{value_1}}" "{{display_text_1}}" "{{value_n}}" "{{display_text_n}}" ..... 3>&1 1>&2 2>&3)`
|
||||
Reference in New Issue
Block a user