This is confusing me.
false || echo "Oops, fail" # Oops, fail
true || echo "Will not be printed" #
true && echo "Things went well" # Things went well
false && echo "Will not be printed" #
true return 0 exit code and false returns 1. I am unable to understand how || and && are working. Do both of them work on exit codes or the actual output of the command? What is the difference between && and || operator here?
The above code snippet is from the missing semester of your CS education lecture 2.