#bash
32 solutions
Add a strict-mode header so scripts stop on unset variables and failing pipes.
Make short commands like ll or backup run your long ones in every new terminal.
Wipe the current session's history and the saved history file.
Static-analyze bash and sh scripts for the quoting bugs, unhandled expansions, and portability traps that cause 3 a.m. incidents.
Make `history` print the date and time each command was executed by setting the HISTTIMEFORMAT variable in your shell config.
Feed the output of two commands directly into diff or other file readers.
Replace predictable /tmp filenames with collision-proof, permission-safe temp paths in scripts.
Embed configuration or scripts inline using <<'EOF' blocks.
Take a file lock so a cron job cannot start while the previous run is active.
Generate many names at once with {a,b} lists and {1..5} ranges.
Register a cleanup handler that runs when your script exits normally, is interrupted with Ctrl-C, or is killed with SIGTERM.
Turn on ** to match files at any depth in the current directory tree.