4 ms·
Even if you can't force it on for everything, the bash construction ${variable:?message} lets you error out on individual null or unset values[1]. Unfortunatel
by nieve 14y ago
Even if you can't force it on for everything, the bash construction ${variable:?message} lets you error out on individual null or unset values[1]. Unfortunately there doesn't seem to be as simple a way to handle all of null, unset, and empty string as rachelbythebay points out is needed. You can fudge it with a test against ${#parameter} (parameter length), but you don't get the direct error effect.
[1] There are a lot of beautiful strangenesses in bash, especially the Parameter Expansion section of the manpage.