我發現SH-腳本CPU節流,並想以下列方式使用AppleScript來安排它在啓動時:做shell腳本導致找不到命令
do shell script "sudo /Users/BohdanAir/Documents/Automation/cputhrottler.sh" "password mypassword" with administrator privileges
並得到以下錯誤:
error "sudo: /Users/BohdanAir/Documents/Automation/cputhrottler.sh: command not found" number 1
PS:提供給sh
文件該過程被完全從Get Info
選項複製(CDM + I)
**不要用'使用'sudo'連同管理員privileges' **見[技術說明2065](https://developer.apple.com/library/content/technotes/tn2065/_index.html)。刪除'sudo' – vadian
雖然瓦里安製造和良好的出發點,但是主要的原因是出現了錯誤是你試圖執行未設置爲可執行,或作爲直接的shell的參數執行執行的腳本。詳情請參閱我的回答。 – user3439894