FIND YOUR NEXT FEW LINES

Results for “variables”

Small, practical examples. Search by task or narrow things down below.

16 snippets foundClear filters
Bash ScriptsParameter expansion

Distinguish unset variables from empty strings

Bash Scripts: Omitting the colon tests only whether a variable is unset; including it also treats an empty value as missing.

Bash Scripts✓ Tested
Docker / ComposeExecution & file transfer

Load environment variables from a file

Docker / Compose: An env file supplies one KEY=value assignment per line.

Docker / Compose✓ Tested
Docker / ComposeCompose service options

Load service variables from an env file

Docker / Compose: env_file supplies runtime environment values.

Docker / Compose✓ Tested
PowerShellStrings & literal text

Write a multiline string without expanding variables

PowerShell: A single-quoted here-string preserves dollar signs literally.

PowerShell✓ Tested
GoGetting Started

Declare and update a variable

Declare and update a variable using a complete Go program with explicit sample inputs.

Go✓ Tested
CSSInteraction & themes

Reuse colors with custom properties

Define a CSS custom property and use it for text color.

CSS✓ Tested
Bash ScriptsGetting Started

Store text in a variable

Bash Scripts: Store text in a variable with a small standalone Bash program.

Bash Scripts✓ Tested
Bash ScriptsVariables & text

Convert a string to lowercase

Normalize a text value using Bash expansion.

lowercase✓ Tested
Bash ScriptsProcesses & environment

Export a value to child processes

Bash Scripts: Only exported shell variables are inherited through the environment.

Bash Scripts✓ Tested
Docker / ComposeDockerfile patterns

Keep exec-form arguments literal

Docker / Compose: JSON exec form does not expand shell environment variables.

Docker / Compose✓ Tested
PowerShellFunctions & parameter validation

Keep function-local assignments separate from caller state

PowerShell: Ordinary function assignments create local variables rather than replacing the caller’s variable.

PowerShell✓ Tested
Bash ScriptsVariables & text

Remove a filename extension

Keep the path while removing its final extension.

filename✓ Tested