These AND and OR equivalents can be used in scripts to determine next actions.
We’ve all probably seen the && and || operators in use from time to time. These AND and OR equivalents are often used in scripts to make decisions about what happens next. In this post, we’ll take a look at how they work at a very basic level and some ways they are often used in scripts.
To begin, the || (OR) operator aligns itself with the use of the word “or” in common day English. However, it makes a clear distinction. If the command on the left side of the || is successfully run, the command on the right is not run. Run the command below and you’ll never see it respond “goodbye”.
On the other hand, if the command on the left of the || fails, the one on the right side will be run.
