2025-07-24 22:27:13 -06:00
|
|
|
# {
|
|
|
|
|
|
|
|
|
|
> Multifunctionele shell-syntax.
|
|
|
|
|
> Meer informatie: <https://www.gnu.org/software/bash/manual/bash.html>.
|
|
|
|
|
|
|
|
|
|
- Isoleer variabele namen:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`echo ${{{HOME}work}}`
|
2025-07-24 22:27:13 -06:00
|
|
|
|
|
|
|
|
- Breid reeksen uit:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`echo {{{1..3}}} {{{a..c}}}{{{dir1,dir2,dir3}}}`
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Controleer of `variabele` is ingesteld voordat tekst wordt geretourneerd:
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`echo ${{{variabele:+variabele is set and contains $variabele}}}`
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Stel standaardwaarden in als `variabele` niet is ingesteld:
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`echo ${{{variabele:-default}}}`
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Geef de lengte van `variabele` in tekens:
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`echo ${{{#variabele}}}`
|
2025-07-24 22:27:13 -06:00
|
|
|
|
|
|
|
|
- Geef een sliced string terug:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`echo ${{{variabele:3:7}}}`
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Breid een `variabele` recursief uit:
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`echo ${{{!variabele}}}`
|
2025-07-24 22:27:13 -06:00
|
|
|
|
|
|
|
|
- Groepeer commando uitvoer:
|
|
|
|
|
|
|
|
|
|
`{ {{commando1; commando2; ...}} } | {{ander_commando}}`
|