Results for “exit status”
Small, practical examples. Search by task or narrow things down below.
Cancel a pending request
jQuery: abort rejects the jqXHR with the abort status.
jQuery✓ Tested
Check whether a file is already sorted
Linux Commands: Use sort -C for a quiet status check that does not rewrite the file.
Linux Commands✓ Tested
Clean up a temporary directory automatically
Use an EXIT trap so temporary files are removed when the script ends.
mktemp✓ Tested
Collect a serial line in a fixed buffer
Read a short command without dynamic String allocation.
serial line✓ Tested
Distinguish an empty input line from end of input
Bash Scripts: A successful read can return an empty value; its status indicates whether a line was read.
Bash Scripts✓ Tested
List newly added staged files only
Git: Filter the cached diff by added status while leaving modified files out.
Git✓ Tested
List the paths with unresolved merge conflicts
Git: The U diff filter identifies unmerged entries without parsing human-readable status output.
Git✓ Tested
Prevent gaining privileges through exec
Docker / Compose: The no-new-privileges flag is visible in process status.
Docker / Compose✓ Tested
Reject a missing required configuration value
Bash Scripts: Check a required value explicitly and emit a controlled diagnostic before exiting.
Bash Scripts✓ Tested
Repeat until a condition becomes true
Bash Scripts: An until loop continues while its test returns a nonzero status.
Bash Scripts✓ Tested
Retrieve a file from a stopped container
Docker / Compose: The writable layer remains available for docker cp after exit.
Docker / Compose✓ Tested
Run a one-off container
Run a command and remove its stopped container automatically.
run✓ Tested