我发现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