0

I have the following lines in my .bashrc which I would like to get executed upon logging in through ssh.

csh
source /x/y/.cshrc
source /x/y/z/sourceme

But the problem is that only the first command is being executed correctly. (csh prompt is coming up) The following source command is not effected. I noticed that there are some errors which are thrown from bash (not csh) for the 'source' command

I read somewhere that this may be due to .bashrc getting executed multiple times. And source commands trying to get executed in bash itself rather than csh.

I want all the three commands to be executed one after other upon log-in. how can I do that? I tried .bash_profile .bash_login etc. Also I don't have write access to /etc/profile

4

3 回答 3

3

“命令”由 bash shell 解释。它们不是要馈送到终端的字节。发生的情况是 csh 以交互方式运行,一旦退出,bash 将获取两个(可能是 csh)脚本文件。

看起来您只是想将您的外壳更改为 csh (为什么,我不知道)。您是否尝试过使用chsh它?

于 2012-08-23T05:16:51.690 回答
1

如果您想在 中运行这些命令csh,请将它们移动到您的.cshrc.

不过要注意一点;绝对使用csh任何东西都会引发问题,你真的认为你知道你在做什么吗?为什么?

于 2012-08-23T06:57:41.760 回答
0

source是一个“bashism”,也就是说它在其他shell中不起作用。改为使用.

于 2012-08-23T07:01:18.157 回答