Results for “command”
Small, practical examples. Search by task or narrow things down below.
Disable networking for a local command
Docker / Compose: Disable networking for a local command using a locally available Ubuntu image.
Docker / Compose✓ Tested
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
Dispatch a command through function pointers
Arduino / C: A small function table can map validated command indices to actions.
Arduino / C✓ Tested
Dispatch a command with case
Choose an action from a small set of supported commands.
case✓ Tested
Dispatch a one-character serial command
Arduino / C: A switch provides explicit handling for accepted and unknown commands.
Arduino / C✓ Tested
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
Handle an expected command failure
Branch on a command’s exit code without aborting the script.
exit status✓ Tested
Inspect every command status in a pipeline
Bash Scripts: Copy PIPESTATUS immediately before another command overwrites it.
Bash Scripts✓ Tested
Inspect the configured container command
Docker / Compose: Inspect the configured container command using a locally available Ubuntu image.
Docker / Compose✓ Tested
Map a command with switch
Map a command with switch using a complete Go program with explicit sample inputs.
Go✓ Tested
Observe command substitution’s trailing-newline removal
Bash Scripts: Command substitution removes trailing newlines while preserving embedded ones.
Bash Scripts✓ Tested
Parse a typed command-line option
Python: Use argparse to validate and convert an integer option.
Python✓ Tested