点击后制作一个可执行文件的bash运行 [英] Making an executable bash file run when clicked

查看:103
本文介绍了点击后制作一个可执行文件的bash运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个bash文件做一些文件操作。我不希望有我每次运行它​​时打开终端。有没有一种方法,使程序运行时,我双击它? (就像一个窗口.exe文件)

I have a bash file that does some file manipulation. I don't want to have to open the terminal every time I run it. Is there a way to make the program run when I double click it? (Like a windows .exe file)

感谢

推荐答案

您可以添加一个.command扩展名 - 然后双击它会自动打开终端,并在新窗口中运行脚本。注:这是假定你还想看/通过终端界面脚本进行交互;如果你想避免这个问题,以及,包装与鸭嘴兽,AppleScript的,或Automator的(如子非鱼和Ned建议)脚本会更好的选择。

You can add a ".command" extension to the filename -- then double-clicking it will automatically open Terminal and run the script in a new window. Note: this assumes you still want to watch/interact with the script via a Terminal interface; if you want to avoid this as well, wrapping the script with Platypus, AppleScript, or Automator (as Zifei and Ned suggest) would be better options.

这篇关于点击后制作一个可执行文件的bash运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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