Results for “aria”
Small, practical examples. Search by task or narrow things down below.
Isolate variable changes in a subshell
Bash Scripts: Parentheses create a subshell whose variable assignments do not change the parent.
Bash Scripts✓ Tested
Keep a function variable local
Bash Scripts: Local prevents an ordinary function assignment from replacing a caller variable.
Bash Scripts✓ Tested
Limit a beginner function variable to local scope
Bash Scripts: Limit a beginner function variable to local scope with a small standalone Bash program.
Bash Scripts✓ Tested
Load environment variables from a file
Docker / Compose: An env file supplies one KEY=value assignment per line.
Docker / Compose✓ Tested
Load service variables from an env file
Docker / Compose: env_file supplies runtime environment values.
Docker / Compose✓ Tested
Match enum variants
Match enum variants in a complete Rust program using the standard library.
Rust✓ Tested
Narrow an object with a pattern variable
Java: Pattern matching avoids a separate cast after a successful instanceof check.
Java✓ Tested
Pass a variable to one command
Linux Commands: Use env to supply a child process value without setting it permanently in the parent shell.
Linux Commands✓ Tested
Pass a variable to standard input
Bash Scripts: A here-string supplies the expanded value followed by a newline.
Bash Scripts✓ Tested
Pass an environment variable
Supply configuration without changing an image.
environment✓ Tested
Prevent a variable value from expanding as a filename pattern
Bash Scripts: Quote a variable to pass its literal contents even when matching filenames exist.
Bash Scripts✓ Tested
Read a variable whose name is stored in another variable
Bash Scripts: Indirect expansion performs one extra variable-name lookup.
Bash Scripts✓ Tested