[英]I need to load some modules but load module doesn't work in my environment unless I change the bash profile. How do I do this in tcsh?
. 。 ~/.bashrc is what I'm use to source the bash script in bash shell.
〜/ .bashrc是我用来在bash shell中提供bash脚本的源代码。 But I have quite a few scripts that I want to run from tcsh.But this command doesn't work for tcsh.
但是我有很多脚本要从tcsh运行,但是此命令不适用于tcsh。 Why doesn't this work?
为什么不起作用? Is there a different file similar to bash profile when I work on t shell?
当我在T Shell上工作时,是否有类似于bash配置文件的其他文件?
Any links to look up? 有任何查找链接吗?
Thx! 谢谢!
The tcsh
equivalent to the bash
and posix shell .
tcsh
相当于bash
和posix shell .
is source
. 是
source
。
That said, bash
and tcsh
are entirely different shells. 也就是说,
bash
和tcsh
是完全不同的shell。 You will not be able to source ~/.bashrc
from tcsh, if that was your intent. 如果这是您的意图,则您将无法从tcsh获取
source ~/.bashrc
。
You can run a shell script of any type as long as that shell script has the appropriate shebang
in its first line, but it'll run in its own process, and not in the context of your interactive tcsh instance. 您可以运行任何类型的shell脚本,只要该shell脚本的第一行具有适当的
shebang
,但它将在其自己的进程中运行,而不是在交互式tcsh实例的上下文中运行。
If, for example, you have a directory: ~/.tcshrc.d
, and you want to include all the files in that directory in your login shell, you might include the following in your .tcshrc
file: 例如,如果您有一个目录:
~/.tcshrc.d
,并且想要将该目录中的所有文件都包含在登录外壳中,则您的.tcshrc
文件中可能包含以下内容:
foreach i ( ~/.tcshrc.d/* )
source $i
end
Note that this is tcsh
code, and is not compatible with bash
. 请注意,这是
tcsh
代码,与bash
不兼容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.