diff --git a/tldr/$ b/tldr/$ index 4475fd8a..bc3b1e7c 100644 --- a/tldr/$ +++ b/tldr/$ @@ -27,3 +27,11 @@ source: https://github.com/tldr-pages/tldr.git - Expand with the output of `command` and run it. Same as enclosing `command` in backtics: `$({{command}})` + +- List how many arguments the current context has: + +`echo $#` + +- Print out a Bash array: + +`echo ${array[@]}` diff --git a/tldr/linux/dialog b/tldr/linux/dialog new file mode 100644 index 00000000..5b6f1549 --- /dev/null +++ b/tldr/linux/dialog @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# dialog + +> Display dialog boxes on the terminal. +> More information: . + +- Display a message: + +`dialog --msgbox "{{Message}}" {{height}} {{width}}` + +- Prompt the user for text: + +`dialog --inputbox "{{Enter text:}}" {{8}} {{40}} 2>{{output.txt}}` + +- Prompt the user for a yes/no question: + +`dialog --yesno "{{Continue?}}" {{7}} {{40}}`