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.

2
  • That's helpful too. Thanks! Commented Nov 12, 2020 at 9:32
  • Not sure what you mean there. && / || are not bashisms. They were already present in the Bourne shell in the 70s. They're also present in csh which make them more portable than if whose syntax is different between Bourne-like shells and csh. Using them in place of if constructs is often considered bad practice though. Note that [ -z "$file" ] would also return true if the script is called with -i '' (likely not a problem in practice) Commented Nov 29, 2021 at 15:28