下面是我用来比较 df 输出与字符串的代码。谁能告诉我为什么它总是返回假?
bash-3.00$ a=$(df -n dir1)
bash-3.00$ b="/opt : ufs"
bash-3.00$ echo "$a"
/opt : ufs
bash-3.00$ echo "$b"
/opt : ufs
bash-3.00$ [[ "$a" = "$b" ]]
bash-3.00$ echo $?
1
bash-3.00$
bash-3.00$ [[ "$a" == "$b" ]]
bash-3.00$ echo $?
1
谢谢,