Linux 无法将布尔值指定给bash中的变量?
我已将Linux 无法将布尔值指定给bash中的变量?,linux,bash,shell,unix,Linux,Bash,Shell,Unix,我已将$weMountedBoot设置为false,就像脚本开头所示: weMountedBoot=false 现在,如果它没有装入,因此条件代码运行,我会得到这个错误,并且变量不是设置为true: ./verifyBootFiles: line 41: false=true: command not found 相关代码: if ! mount | grep "/boot" > /dev/null then sudo mount -r -U $toCheck $
$weMountedBoot
设置为false,就像脚本开头所示:
weMountedBoot=false
现在,如果它没有装入,因此条件代码运行,我会得到这个错误,并且变量不是设置为true:
./verifyBootFiles: line 41: false=true: command not found
相关代码:
if ! mount | grep "/boot" > /dev/null
then
sudo mount -r -U $toCheck $mountPoint
$weMountedBoot=true
fi
怎么了?你可能认为我真的很喜欢shell脚本,而且有丰富的经验。。。因此,关于代码的任何其他注释都是受欢迎的。只需删除前导的
$
$weMountedBoot=true
将是weMountedBoot=true
记住向上投票并选择最佳答案。很遗憾,投票需要15次代表。。。但我会记得。。。