FIND YOUR NEXT FEW LINES

Results for “command”

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

296 snippets foundClear filters
Docker / ComposeGetting Started

Disable networking for a local command

Docker / Compose: Disable networking for a local command using a locally available Ubuntu image.

Docker / Compose✓ Tested
PowerShellCommands & execution context

Discard incidental output from a setup command

PowerShell: Out-Null prevents setup objects from becoming part of a function or script’s useful result.

PowerShell✓ Tested
Arduino / CArrays & embedded state

Dispatch a command through function pointers

Arduino / C: A small function table can map validated command indices to actions.

Arduino / C✓ Tested
Bash ScriptsLoops & decisions

Dispatch a command with case

Choose an action from a small set of supported commands.

case✓ Tested
Arduino / CSerial protocols

Dispatch a one-character serial command

Arduino / C: A switch provides explicit handling for accepted and unknown commands.

Arduino / C✓ Tested
Docker / ComposeGetting Started

Drop Linux capabilities for a simple command

Docker / Compose: Drop Linux capabilities for a simple command using a locally available Ubuntu image.

Docker / Compose✓ Tested
Bash ScriptsFunctions & arguments

Handle an expected command failure

Branch on a command’s exit code without aborting the script.

exit status✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Inspect every command status in a pipeline

Bash Scripts: Copy PIPESTATUS immediately before another command overwrites it.

Bash Scripts✓ Tested
Docker / ComposeGetting Started

Inspect the configured container command

Docker / Compose: Inspect the configured container command using a locally available Ubuntu image.

Docker / Compose✓ Tested
GoGetting Started

Map a command with switch

Map a command with switch using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsFunction scope & composition

Observe command substitution’s trailing-newline removal

Bash Scripts: Command substitution removes trailing newlines while preserving embedded ones.

Bash Scripts✓ Tested
PythonFunctions & error handling

Parse a typed command-line option

Python: Use argparse to validate and convert an integer option.

Python✓ Tested