Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用ssh的Tramp不支持source.bash\u profile/.profile_Bash_Emacs_Aquamacs_Tramp - Fatal编程技术网

使用ssh的Tramp不支持source.bash\u profile/.profile

使用ssh的Tramp不支持source.bash\u profile/.profile,bash,emacs,aquamacs,tramp,Bash,Emacs,Aquamacs,Tramp,我正在使用Aquamacs(使用emacs 24和tramp版本2.2.3的OSX图形emacs)编辑远程服务器上的一些文件。Tramp被设置为使用sshssh,并且可以很好地编辑文件 编译时失败,因为编译器不在路径中。tramp似乎不提供任何配置文件,如.profile或.bash\u profile。 /bin/sh是指向/bin/bash的链接,因此bash应该是tramp使用的shell。在远程服务器上的emacs中启动的shell也不会提供任何源代码。 来自常规终端仿真器(OSX上的试

我正在使用Aquamacs(使用emacs 24和tramp版本2.2.3的OSX图形emacs)编辑远程服务器上的一些文件。Tramp被设置为使用sshssh,并且可以很好地编辑文件

编译时失败,因为编译器不在路径中。tramp似乎不提供任何配置文件,如.profile.bash\u profile。 /bin/sh是指向/bin/bash的链接,因此bash应该是tramp使用的shell。在远程服务器上的emacs中启动的shell也不会提供任何源代码。 来自常规终端仿真器(OSX上的试用终端和X11)的ssh连接按预期工作(所有源代码都正确)

有什么想法吗

/bin/sh是指向/bin/bash的链接,因此bash应该是 流浪汉

不一样。当作为“sh”调用时,它的行为将类似于sh而不是 bash,因此是特定于bash的rc/profile文件(例如~/.bash\u profile, ~/.bashrc)将不会被获取。但是~/.profile将被读取。你的 问题可能是您正在使用bash语法在您的应用程序中设置内容 ~/.profile

这是行不通的:

export PATH=/some/path:$PATH
但这将:

PATH=/some/path:$PATH
export PATH

我遇到了这个问题,从shell历史记录中可以看出,tramp正在以非登录shell的形式执行
/bin/sh
,这意味着
~/.profile
将不会执行

这听起来像emacs手册所说的:

另一种查找远程路径的方法是使用远程主机分配给远程用户的路径。在登录后,Tramp通常不会保留此远程路径。但是,tramp自身的远程路径保留路径值,该值可用于更新tramp远程路径

      (add-to-list 'tramp-remote-path 'tramp-own-remote-path)
请注意,只有当您的remote/bin/sh shell支持登录参数'-l'时,这才有效

如前所述,将
'tramp-own-remote-path
添加到
tramp-remote-path
,将
-l
标志添加到我在历史记录中看到的命令中,并按预期来源于
~/.profile


(这在中链接的问题中进行了描述,但没有提到寻源
~/.profile
,这意味着可以在该文件中进行其他环境自定义。)

在我的情况下,完全忽略了profile。在调用/bin/sh时手动查找它实际上会产生一个正确的路径,但在它自己的tramp上似乎不会生成~/.profile。我不确定将
导出路径
放在
~/.profile
~/.bash_profile
中的单独一行是否会让tramp理解它,但我试图让tramp以类似的方式设置
编辑器
,但它在
~/.profile
~/.bash_profile
中都不起作用,所以我最终通过
tramp远程进程环境
再次设置了它,正如我在,这并不完全方便,因为不同的远程主机可能需要不同的值。相关问题位于:。