I tried to declare a Boolean variable in a shell script using the following syntax: 我尝试使用如下语法在Shell脚本中声明布尔变量: shell
variable=$false variable=$true
Is this correct? 这个对吗? Also, if I wanted to update that variable would I use the same syntax? 另外,若是我想更新该变量,我会使用相同的语法吗? Finally, is the following syntax for using Boolean variables as expressions correct? 最后,使用布尔变量做为表达式的如下语法正确吗? express
if [ $variable ] if [ !$variable ]