Category: CLI & System
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
CLI Arguments with yargs (Node)
Declare commands and flags with yargs in a Node script.
Author:
chris
Parse argv in a PHP CLI Script
Hand-roll CLI parsing using \$argv when getopt is overkill.
Author:
chris
Parse Flags with the flag Package
Parse typed CLI flags using the stdlib flag package.
Author:
chris