Skip to content

Comment on Writing Robust Bash Shell Scripts

Comments

  set -u
Another great thing I could have read in the effin manual.

He could have added a little reminder about the ${VAR:-default} syntax. [[ http://www.ooblick.com/text/sh/ search for Quasi-variable constructs ]]

Great read, thanks.

Or look at the manpage

       ${parameter:-word}
              Use  Default  Values.  If parameter is unset or null, the expan-
              sion of word is substituted.  Otherwise, the value of  parameter
              is substituted.

Agreed, I was just sayin for the sake of the article, he brings up the subject of unitialized variables, without mentioning this other way.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.