emacs - PATH Mac OSX 终端中的脚本不起作用

标签 emacs path bash startupscript

我的/path/to/startupscripts 目录中有以下脚本,因此我可以使用命令“emacs”打开 emacs GUI:

#!/bin/sh
/Applications/Emacs.app/Contents/MacOS/Emacs "$@"

我编辑了 ~/.bash_profile 并添加了以下行

export PATH=/path/to/startupscripts/emacs:$PATH

但是,该脚本无法正常工作,因为当我在命令行中输入“emacs”时,emacs 仍然在终端中打开,而不是像我想要的那样打开 GUI。另外,当我位于/path/to/startupscripts 目录中时,我可以执行并运行脚本

chmod +x emacs
./emacs

但即使我随后输入“emacs”,它仍然会在终端中打开。我是一个有点初学者,我认为我错过了一些非常明显的痛苦。

最佳答案

PATH 应包含可以找到脚本的目录名称,而不是单个脚本的名称。

关于emacs - PATH Mac OSX 终端中的脚本不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25574104/

相关文章:

bash - 使用 bash 过滤文件名

linux - Echo 无法打印 "*.*"字符串

linux - 如何将左三角形 (<) 作为别名命令的一部分包含在内?

c++ - gdb 在 Emacs 中不接受 stdin 重定向

clojure 的 emacs slime-connect 版本不会查找 $CLASSPATH

python - 我正在 Windows 10 计算机上的 python 上使用 openpyxl 库,并尝试使用空格加载 load_workbook

c - 我如何修改此代码,以便打印从 A 点到 B 点所需路径的输出

python - Emacs Python 劣质 shell 在 matplotlib show() 命令后不显示提示

Emacs 键绑定(bind)在自定义主模式下不起作用

bash - 如何将目录添加到文件.bashrc中的PATH?