...
-e errexit
Exit immediately if any untested command fails in non-interactive
mode...
-u nounset
Write a message to standard error when attempting to expand a
variable...
Both `set -eu` and `shellcheck` tools are overrated.
I have used `shellcheck` against many of my scripts and for 'well think and designed' scripts its like a 'false positive generator' tool that only waste my time.
I mean ... POSIX /bin/sh is a language like any other - like Python - like Perl ...
I have been writing scripts since 20+ years in POSIX /bin/sh tools and thinking and knowing what and how a thing can fail always wins.
... and as FreeBSD has ZFS Boot Environments (and even UFS Boot Environments) - no matter what fails and where - You are always protected from failures.
The `set -eu` is treated like some magic 'Save Game' thing - that after You set it in a script - You are always protected from everything ... You are not.
A command that will wipe Your entire / filesystem can succeed without an issue and You will see zero errors.