Bash
Retry a shell command with backoff
Re-run a flaky command a few times with increasing delays and a clear failure exit code.
Loading snippets…
6 snippets
Re-run a flaky command a few times with increasing delays and a clear failure exit code.
Handle -v, -o FILE and -h in a bash script with getopts and a usage message.
Process many files concurrently with xargs -P, safely handling spaces and newlines in names.
Small log, warn and die helpers that write ISO timestamps to stderr and keep stdout clean for data.
Create a temp directory and guarantee it is removed when the script exits, fails or is interrupted.
Fail early with a helpful message when a script depends on tools that are missing.