Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    Thanks for the explanation of how parameter expansion is handled differently. That cleared up a lot of things to me. Commented Jun 15, 2015 at 16:38
  • I'm granting you the bounty because your explanation was most helpful. Commented Jun 19, 2015 at 9:48
  • @dvdgsng - Gracias. Out of curiosity, did you ever come up w/ your solution? Commented Jun 19, 2015 at 9:49
  • Damn, macos ships with this bug! $ bash --version; GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17); Copyright (C) 2007 Free Software Foundation, Inc. - shell options: hB; temp.sh: line 4: UNSET_VAR: unbound variable; EXIT (rc: 0) Commented Jan 15, 2020 at 5:52
  • From this workaround, you can also check the error status ($?) in your EXIT trap. unix.stackexchange.com/a/678015/38788 Commented Jun 29, 2022 at 15:56