mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-24 01:03:52 +02:00
{: add placeholders (#17661)
This commit is contained in:
parent
4cd201954c
commit
ca0a29d671
1 changed files with 7 additions and 7 deletions
|
@ -5,31 +5,31 @@
|
|||
|
||||
- Isolate variable names:
|
||||
|
||||
`echo ${HOME}work`
|
||||
`echo ${{{HOME}work}}`
|
||||
|
||||
- Brace expand sequences:
|
||||
|
||||
`echo {1..3} {a..c}{dir1,dir2,dir3}`
|
||||
`echo {{{1..3}}} {{{a..c}}}{{{dir1,dir2,dir3}}}`
|
||||
|
||||
- Check if `variable` is set before returning text:
|
||||
|
||||
`echo ${variable:+variable is set and contains $variable}`
|
||||
`echo ${{{variable:+variable is set and contains $variable}}}`
|
||||
|
||||
- Set default values in case `variable` is unset:
|
||||
|
||||
`echo ${variable:-default}`
|
||||
`echo ${{{variable:-default}}}`
|
||||
|
||||
- Return `variable` length in characters:
|
||||
|
||||
`echo ${#variable}`
|
||||
`echo ${{{#variable}}}`
|
||||
|
||||
- Return a string slice:
|
||||
|
||||
`echo ${variable:3:7}`
|
||||
`echo ${{{variable:3:7}}}`
|
||||
|
||||
- Recursively expand a `variable`:
|
||||
|
||||
`echo ${!variable}`
|
||||
`echo ${{{!variable}}}`
|
||||
|
||||
- Group command output together:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue