bash
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
bash [2012/11/28 19:56] – [If File Comparision] k2patel | bash [2017/07/02 02:13] – old revision restored (2013/05/08 17:56) k2patel | ||
---|---|---|---|
Line 364: | Line 364: | ||
HISTTIMEFORMAT=" | HISTTIMEFORMAT=" | ||
</ | </ | ||
+ | |||
+ | === Truth Table === | ||
+ | <code bash> | ||
+ | These two commands not the same: | ||
+ | |||
+ | command1 && command2 || command3 | ||
+ | |||
+ | if command1 | ||
+ | then | ||
+ | command2 | ||
+ | else | ||
+ | command3 | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | In the if-then-else, | ||
+ | |||
+ | <code bash> | ||
+ | for c1 in true false; do for c2 in true false; do echo "$c1 && $c2 || c3"; (echo c1; $c1) && (echo c2; $c2) || echo c3; done; done | ||
+ | </ | ||
+ | |||
+ | And the output: | ||
+ | |||
+ | <code bash> | ||
+ | true && true || c3 | ||
+ | c1 | ||
+ | c2 | ||
+ | true && false || c3 | ||
+ | c1 | ||
+ | c2 | ||
+ | c3 | ||
+ | false && true || c3 | ||
+ | c1 | ||
+ | c3 | ||
+ | false && false || c3 | ||
+ | c1 | ||
+ | c3 | ||
+ | </ | ||
+ | [[ http:// | ||
==== Networked Info ==== | ==== Networked Info ==== | ||
bash.txt · Last modified: 2020/08/10 02:35 by 127.0.0.1