FIND YOUR NEXT FEW LINES

Results for “exit”

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

23 snippets foundClear filters
Bash ScriptsFiles & reliability

Detect an error inside a pipeline

Use pipefail to observe failure before the last pipeline command.

pipefail✓ Tested
PythonFunctions & error handling

Handle an expected child-process failure

Python: Catch CalledProcessError when check=True reports a nonzero exit status.

Python✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Reject a missing required configuration value

Bash Scripts: Check a required value explicitly and emit a controlled diagnostic before exiting.

Bash Scripts✓ Tested
Docker / ComposeExecution & file transfer

Retrieve a file from a stopped container

Docker / Compose: The writable layer remains available for docker cp after exit.

Docker / Compose✓ Tested
Bash ScriptsFunctions & arguments

Return text from a shell function

Capture a function’s output with command substitution.

function✓ Tested
Docker / ComposeContainer commands

Run a one-off container

Run a command and remove its stopped container automatically.

run✓ Tested
C++Ownership & optional values

Run cleanup through a scoped destructor

C++: A stack object’s destructor runs when its scope exits, including normal exception unwinding.

C++✓ Tested
Docker / ComposeStorage & isolation

Run with a read-only root filesystem

Add a temporary writable location while protecting the image filesystem.

read-only✓ Tested
Bash ScriptsProcesses & environment

Stop a child process created by the script

Bash Scripts: Send a signal only to the captured PID of the script’s own child and wait for it to exit.

Bash Scripts✓ Tested
Bash ScriptsArguments & decisions

Stop a search loop at the first match

Bash Scripts: Break exits the current loop as soon as the desired item is found.

Bash Scripts✓ Tested
GitBranches & ancestry

Test whether one revision is an ancestor of another

Git: merge-base --is-ancestor reports its answer through the exit status.

Git✓ Tested