2

我正在尝试编写一个脚本,该脚本将在 Finder 中显示和隐藏隐藏文件之间切换,但我遇到了错误:

./HiddenFileToggle:第 1 行:[默认值:找不到命令

if [defaults read com.apple.finder AppleShowAllFiles]
then
defaults write com.apple.finder AppleShowAllFiles TRUE
else
defaults write com.apple.finder AppleShowAllFiles FALSE
fi
killall Finder
4

1 回答 1

2

将命令括在反引号中`

`defaults read com.apple.finder AppleShowAllFiles`
于 2013-05-07T13:52:51.943 回答