FIND YOUR NEXT FEW LINES

Results for “shell”

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

150 snippets foundClear filters
Docker / ComposeContainer commands

Pass an environment variable

Supply configuration without changing an image.

environment✓ Tested
Docker / ComposeCompose service options

Pass dollar expressions through Compose

Docker / Compose: Double dollar signs defer expansion to the container shell.

Docker / Compose✓ Tested
PowerShellFunctions & control

Pass named parameters from a hashtable

Keep a command’s options together in a reusable object.

splatting✓ Tested
Docker / ComposeBuild images

Provide a default environment value

Set a runtime default that can be overridden at startup.

Dockerfile✓ Tested
PowerShellFiles & paths

Read a whole text file

Load text as one string instead of one item per line.

Get-Content✓ Tested
PowerShellText & data

Read rows from CSV text

Parse CSV into objects with named properties.

CSV✓ Tested
Bash ScriptsInput streams & redirection

Redirect an entire group of commands

Bash Scripts: Brace grouping runs in the current shell and shares a single output redirection.

Bash Scripts✓ Tested
Bash ScriptsVariables & text

Replace every occurrence in a string

Substitute text directly with Bash parameter expansion.

replace✓ Tested
PowerShellText & data

Replace repeated whitespace

Normalize runs of whitespace to one space.

regex✓ Tested
PowerShellCollections & objects

Select object properties

Create a smaller object with only the fields you need.

Select-Object✓ Tested
PowerShellText & data

Serialize a hashtable as JSON

Produce compact JSON for a small data object.

JSON✓ Tested
Bash ScriptsProcesses & environment

Set an environment value for one child command

Bash Scripts: A command-prefix assignment is visible to that command without overwriting the shell’s current variable.

Bash Scripts✓ Tested