mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-18 19:01:10 +00:00
Update cheatsheets
This commit is contained in:
14
tldr/{
14
tldr/{
@@ -10,31 +10,31 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user