Language: Bash
Loop SSH Across Hosts
Run the same command on a list of hosts with -o BatchMode for key-only auth.
Author:
chris
Install a Cron Job from a Script
Append a cron line idempotently with grep -q before crontab.
Author:
chris
Trap SIGINT for Cleanup
Use `trap` to remove a tempdir even when the user hits Ctrl-C.
Author:
chris
Check if a Command Exists
Use `command -v` — portable, no subshell, returns nonzero if missing.
Author:
chris
Date Arithmetic in Bash
GNU date supports relative expressions — yesterday, +7 days, etc.
Author:
chris