Logical operations: Difference between revisions
Content deleted Content added
→{{header|UNIX Shell}}: Add implementation. |
|||
Line 3,893:
=={{header|UNIX Shell}}==
The shell has at least two levels of logical operators. Conditional logic (<tt>if</tt>, <tt>while</tt>, <tt>&&</tt> and <tt>||</tt> at the statement level) operates on commands; the commands are executed, and their exit status determines their value in a Boolean context. If they return an exit code of 0, signaling successful execution, that is considered a "true" result; if they return a nonzero exit code, signaling a failure condition, that is considered a "false" result. However, these results are not returned as a Boolean value. <tt>if command; then do something; fi</tt> will do something if the
{{works with|Bourne Again SHell}}
Line 3,928:
1 or 0 = 1
not 1 = 0</pre>
=={{header|V}}==
|