Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
jakejarvis
7y ago
0 comments
Save
Share
TIL that this quick trick [1] also would have prevented this:
${STEAMROOT:?}
...where :? throws an error if the variable is unset or empty. (Still far too scary for my taste, though!)
[1]
https://github.com/koalaman/shellcheck/wiki/SC2115
0 comments
2 comments · 2 top-level
top
newest
oldest
majewsky
7y ago
Or you just do
set -euo pipefail
as the first thing in your bash script which you absolutely should do every single time.
OJFord
7y ago
Note that's bash not POSIX though right?
j
/
k
navigate · click thread line to collapse