1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-28 21:15:27 +02:00
tldr/pages/common/{.md
Sebastiaan Speck 9185fbf1fe
pages*/common: allow character in title (#16805)
Co-authored-by: Darío Hereñú <magallania@gmail.com>
2025-06-10 06:24:18 +02:00

36 lines
675 B
Markdown

# {
> Multipurpose shell syntax.
> More information: <https://www.gnu.org/software/bash/manual/bash.html>.
- Isolate variable names:
`echo ${HOME}work`
- Brace expand sequences:
`echo {1..3} {a..c}{dir1,dir2,dir3}`
- Check if `variable` is set before returning text:
`echo ${variable:+variable is set and contains $variable}`
- Set default values in case `variable` is unset:
`echo ${variable:-default}`
- Return `variable` length in characters:
`echo ${#variable}`
- Return a string slice:
`echo ${variable:3:7}`
- Recursively expand a `variable`:
`echo ${!variable}`
- Group command output together:
`{ {{command1; command2; ...}} } | {{another_command}}`