【发布时间】:2017-12-16 22:20:04
【问题描述】:
我关注这个帖子 How to declare and use boolean variables in shell script?
并开发了一个简单的shell脚本
#!/bin/sh
a=false
if [[ $a ]];
then
echo "a is true"
else
echo "a is false"
fi
输出是
a is true
怎么了?
【问题讨论】:
-
if [[ $a ]]不是您链接的问题的任何答案中列出的选项之一。
标签: shell boolean logical-operators