Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
因此,对于所有有才华的人来说,这是一个简单的方法。:) 我想做的是创建一个 Automator 应用程序,当您在其上放置一个 .command 文件时,它会执行以下简单的终端命令,其文件名以“abc-123”开头,重要的是它会抛出错误,如果不满足这些条件并且不会尝试运行脚本。
chmod 777 file.command ./file.command
而已!我在这方面没有太多经验,并且已经尝试用谷歌的方式回答 2 个小时,我想我只是问一下,因为它可能很简单......我希望。:)
像这样在 bash shell 中:
for f in "$@" do name=${f##*/}; if [[ "$name" = abc-123*.command ]];then chmod 777 "$f" "$f" else exit 1; fi done