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*

4
  • As shown in the OP, \if doesn't work in zsh. It also doesn't work in bash. Any workarounds for those shells? Commented Jul 15, 2018 at 11:44
  • Thanks for the pointer re POSIX. I found and quoted it in the question. Commented Jul 15, 2018 at 12:01
  • We had seral related discussions in the POSIX teleconferences during the last 6 months. Did you read my explanation on why \if does not work. Since if is not a builtin but part of the syntax, your builtin call cannot help. Do you have a real world problem this question is based on? Commented Jul 15, 2018 at 13:29
  • Not a real-world problem. I needed to disable zsh global aliases as they were causing syntax errors in a sourced file. I came across this question while trying to avoid all aliases in the process of saving zsh option aliases and then setting no_aliases. Commented Jul 16, 2018 at 5:18