The boolean data type is not directly supported in Linux bash shell. But you can use normal variables as boolean in the below ways –
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
b=true if $b then echo "its true" else echo "its false" fi b="false" if [ "$b" == "false" ] then echo "its false" else echo "its true" fi |