简体   繁体   English

我需要加载一些模块,但是除非更改bash配置文件,否则加载模块在我的环境中不起作用。 如何在tcsh中执行此操作?

[英]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. 也就是说, bashtcsh是完全不同的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.

相关问题 在BASH中,我需要根据perl脚本的输出来更改一些环境变量。 在tcsh中,我可以使用别名eval组合。 不能狂欢 - In BASH I need to change some environment variables based on output of a perl script. In tcsh I can use an alias eval combo. Can't in bash 如何以 tcsh 作为 shell 而不是 Bash 运行基于 linux 的 docker 容器? - How do I run the linux based docker container with tcsh as the shell instead of Bash? 我下载并安装了Linux bash配置文件,它彻底改变了我的终端。 如何切换回之前的个人资料? - I downloaded and installed linux bash profile and it completely changed my terminal. How do I switch back to the profile I had before? 如何动态加载自己的库,并在其中调用方法? - How do I load my own library dynamically, and invoke a method in it? 我需要打印行号以及用户提示的内容,怎么做? 我尝试了以下代码,但它不起作用 - I need to print the line number along with the content prompting from user, How to do that? I tried this following code but it doesn't work 在开始我的项目之前,我首先需要docker环境吗? - Do I first need docker environment before starting my project? 默认bash环境已更改。 如何将其恢复为默认值? - Default bash environment changed. How do I revert it to default? Debian:使用 load-modules.conf 加载的模块 can-dev 无法正常工作,直到我手动重新加载它 - Debian: Module can-dev loaded with load-modules.conf does not work until I reload it manually 如何在Linux上制作混合的bash / tcsh脚本? - How can I make a hybrid bash/tcsh script on Linux? 如果没有得到期望的整数值,如何终止脚本? -BASH Shell脚本 - How do i terminate my script if i don't get an expected integer value? - BASH Shell Script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM