What's the meaning of the operator || in linux shell?
linux, shell
Solution
It's equivalent to boolean "or" with short-circuiting evaluation, such that it will execute the second command only if the first returns some value corresponding to "false". For example:
false || echo "foo"
echoes "foo", while
true || echo "foo"
Prints nothing. The `&&` operator provides a complimentary operation.
Problem
I found this piece of code in a .sh script: ``` (test -x "$1" || which "$1") ``` What does this operator `||` mean?