這裏是我的腳本:TRUE/FALSE的if/then/else語句shell腳本
#!/bin/bash
result=$(xfconf-query -c xsettings -p /Gtk/ShellShowsMenubar)
if $result == "false"
then
xfconf-query -c xsettings -p /Gtk/ShellShowsMenubar -n -t bool -s true
else
xfconf-query -c xsettings -p /Gtk/ShellShowsMenubar -n -t bool -s false
fi
它輸出沒有錯誤,但它也不起作用。
可以請你 '如果[$結果==假]嘗試' 請注意有每個字符和空格之間'FALSE'不是雙引號裏面 –
[不要在使用$作業左側](https://github.com/koalaman/shellcheck/wiki/SC1066),並且始終將腳本複製粘貼到http://www.shellcheck.net/以修復語法違規 – Inian
沒有顯示輸出? – Kruser