Difference between revisions of "Bash"
From John Freier
(→One line conditional) |
(→One line conditional) |
||
Line 2: | Line 2: | ||
== One line conditional == | == One line conditional == | ||
Both the following lines will write to the screen "false" | Both the following lines will write to the screen "false" | ||
− | [[ 1 == 0 | + | [[ 1 == 0 ]] || echo "text" |
\[\[ 1 == 1 \]\] && echo "text" | \[\[ 1 == 1 \]\] && echo "text" |
Revision as of 15:21, 29 April 2021
One line conditional
Both the following lines will write to the screen "false"
1 == 0 || echo "text"
\[\[ 1 == 1 \]\] && echo "text"