【发布时间】:2011-11-14 05:03:11
【问题描述】:
一旦我导航到其中包含 .command 文件的某个目录,如何使用终端执行该文件?
【问题讨论】:
-
这取决于该文件的内容。针对该文件运行
file命令的输出是什么,例如file /somedir/somefile.command?
标签: macos unix command-line terminal command
一旦我导航到其中包含 .command 文件的某个目录,如何使用终端执行该文件?
【问题讨论】:
file 命令的输出是什么,例如file /somedir/somefile.command?
标签: macos unix command-line terminal command
如果你想像在 Finder 中双击一样执行它,你可以使用open foo.command。这将产生一个新的终端窗口。如果你想“内联”执行它,你可以使用./foo.command,因为 .command 文件必须设置 exec 位才能运行。
【讨论】: