-1
彼氏、 現在私は仕事のための初心者のbashfileを書いています。唯一の目的は、ワンクリックで隠しファイルを表示/非表示にすることです。私の最後のスクリプトは年齢前だったと私はここで、適切なソリューションのための研究と、このスクリプトを作った:これは私がよくMacOSのbashファイルif-thenが動作しない
#!/bin/bash
if defaults write com.apple.finder AppleShowAllFiles 0
then
defaults write com.apple.finder AppleShowAllFiles 1
elif defaults write com.apple.finder AppleShowAllFiles 1
then
defaults write com.apple.finder AppleShowAllFiles 0
fi
を試して正常に動作しませんでした後
#!/bin/bash
if defaults write com.apple.finder AppleShowAllFiles 0
then
defaults write com.apple.finder AppleShowAllFiles 1
else
defaults write com.apple.finder AppleShowAllFiles 0
fi
- 仕事の両方を一部。したがって、最初の引数がtrue(AppleShowAllFiles 0)の場合、値は1に設定されますが、それ以外の方法では機能しません。Else-conditionは何もしません。 AppleShowallFiles 0がfalse(AppleShowAllFiles 1を意味する)であれば、何もしません。 どうして私は間違ったことをしたのですが、どうすれば修正できますか?
本当に有益な回答と感謝しています。