Mac OS X-从桌面GUI运行Shell脚本 [英] Mac OS X - run shell script from the desktop GUI

查看:258
本文介绍了Mac OS X-从桌面GUI运行Shell脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以创建一个Shell脚本或Python或Ruby脚本,然后使用终端"在Mac上运行... ...如果已打开Finder,然后单击包含源代码的文件的图标保存的shell脚本,有没有一种方法可以运行该脚本,而不是在我的文本编辑器中打开?

You can create a shell script or a Python or Ruby script and run it on the Mac by using "Terminal" ... if you have Finder open, and you click on the icon for the file containing the source code of a saved shell script, is there a way to have that script run, instead of opening in my text editor ?

推荐答案

是的-只需在脚本上添加.command后缀即可.

Yes - just put a .command suffix on the script.

注意:确保脚本是可执行的,例如

Note: make sure the script is executable, e.g.

$ chmod +x myscript.command

这篇关于Mac OS X-从桌面GUI运行Shell脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆