Setup
We’re going to use zsh as it is always available on any system I use:
#! /bin/zsh
We’ll want stricter defaults out of the box:
Option |
Description |
|---|---|
|
Exit immediately if a command exits with a non-zero status. |
|
Don’t allow |
|
Treat unset variables as an error. |
|
Warn when a global variable is created. |
setopt err_exit no_clobber no_unset warn_create_global
We’ll need zutil to allow us to process command line arguments:
zmodload -F zsh/zutil +b:zparseopts