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 ]