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*

3
  • 1
    For those unfamiliar with ${var+foo}, it evaluates to foo if var is set, even if empty, and nothing otherwise. Commented Jan 2, 2016 at 0:31
  • Say, do you have any comments on typeset +x vs export -n for the shells that do support the former? Is export -n rarer, or does it not preserve some properties? Commented Jan 2, 2016 at 3:44
  • @muru If you're writing a bash script, you can use export -n or typeset +x indifferently. In ksh or zsh, there's only typeset +x. Commented Jan 2, 2016 at 7:36