您可以创建一个shell脚本或Python或Ruby脚本,并使用“终端”在Mac上运行它...如果您打开Finder,并单击包含已保存shell脚本源代码的文件的图标有没有办法让脚本运行,而不是在我的文本编辑器中打开?
Yes - just put a .command
suffix on the script.
Note: make sure the script is executable, eg
$ chmod +x myscript.command
Just another quick alternative is the tool platypus ( http://sveinbjorn.org/platypus/ ). Free and good, but you can donate, if you want.
Platypus is a developer tool for the Mac OS X operating system. It creates native Mac OS X applications from interpreted scripts such as shell scripts or Perl, Ruby and Python programs. This is done by wrapping the script in an application bundle along with a native executable binary that runs the script.
只需将.sh文件与Terminal.app关联即可
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.