Results for “command”
Small, practical examples. Search by task or narrow things down below.
Bound a command execution time
Linux Commands: Use timeout and handle status 124 as an expected time limit.
Linux Commands✓ Tested
Branch on a command’s exit status
Linux Commands: Branch on a command’s exit status using GNU/Linux commands in an empty practice directory.
Linux Commands✓ Tested
Build an image with a default command
Docker / Compose: Build an image with a default command with a complete introductory Dockerfile.
Docker / Compose✓ Tested
Capture a command’s output
Bash Scripts: Capture a command’s output with a small standalone Bash program.
Bash Scripts✓ Tested
Capture a command’s success-stream output
PowerShell: Assignment collects output values without requiring text redirection to a file.
PowerShell✓ Tested
Capture output while handling a failed command
Bash Scripts: An assignment inherits the status of its command substitution, allowing both output and status to be handled.
Bash Scripts✓ Tested
Check for an installed command
Bash Scripts: command -v checks command resolution without assuming a specific installation path.
Bash Scripts✓ Tested
Check whether a command can be resolved
PowerShell: Get-Command with a local error override supports an expected missing-command lookup.
PowerShell✓ Tested
Choose Bash with pipefail for build commands
Docker / Compose: SHELL changes the interpreter for subsequent shell-form instructions.
Docker / Compose✓ Tested
Choose the command a container executes
Docker / Compose: Choose the command a container executes using a locally available Ubuntu image.
Docker / Compose✓ Tested
Compare a command case-sensitively
Arduino / C: strcmp returns zero when both null-terminated strings match.
Arduino / C✓ Tested
Disable networking for a Compose command
Docker / Compose: Disable networking for a Compose command in a small Compose file.
Docker / Compose✓ Tested