使用ssh的流浪者不会获取.bash_profile/.profile [英] Tramp using ssh does not source .bash_profile / .profile

查看:338
本文介绍了使用ssh的流浪者不会获取.bash_profile/.profile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Aquamacs(用于OSX的图形emacs,使用emacs 24和2.2.3版本)在远程服务器上编辑一些文件. Tramp设置为使用 ssh ,并且在编辑文件方面运行良好.

I'm using Aquamacs (graphical emacs for OSX using emacs 24 and tramp version 2.2.3) to edit some files on a remote server. Tramp is set up to use ssh and works fine in terms of editing files.

在编译时失败,因为编译器不在路径中.似乎流浪汉没有提供任何配置文件,例如 .profile .bash_profile . /bin/sh是/bin/bash的链接,因此bash应该是流浪汉使用的shell.在远程服务器上的emacs中启动的shell也不会提供任何资源. 来自常规终端仿真器(在OS X上尝试过 Terminal X11 )的ssh连接可以按预期的方式工作(所有来源均正确).

It fails when it comes to compiling because the compiler is not in the path. It seems like tramp does not source any of the profile files like .profile or .bash_profile. /bin/sh is a link to /bin/bash so bash should be the shell used by tramp. A shell started within emacs on the remote server won't source anything, too. A ssh connection from a regular terminal emulator (tried Terminal and X11 on OS X) works as expected (everything sourced correctly).

有什么想法吗?

推荐答案

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

/bin/sh is a link to /bin/bash so bash should be the shell used by tramp.

不一样.当作为"sh"调用时,它的行为类似于sh而不是 bash,因此是bash专用的rc/profile文件(例如〜/.bash_profile, 〜/.bashrc)将不会被获取.但是〜/.profile将被读取.你的 问题可能是您正在使用bash语法在您的设备中设置内容 〜/.profile.

Its not the same. When invoked as "sh", it will behave like sh and not bash, hence the bash specific rc/profile files (e.g. ~/.bash_profile, ~/.bashrc) won't be sourced. However ~/.profile will be read. Your problem might be you are using bash syntax to setup stuff in your ~/.profile.

这不起作用:

export PATH=/some/path:$PATH

但这会:

PATH=/some/path:$PATH
export PATH

这篇关于使用ssh的流浪者不会获取.bash_profile/.profile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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