简体   繁体   English

导出:未找到由 linux 源命令引发的命令

[英]export: Command not found raised by linux source command

after I installed Anaconda package on the server, I'm then trying source ~/.bashrc to set env variable, but it raise an error of export: Command not found , my .bashrc file is like this:在服务器上安装 Anaconda 包后,我尝试使用source ~/.bashrc来设置 env 变量,但它引发了export: Command not found错误export: Command not found ,我的.bashrc文件是这样的:

# added by Anaconda3 4.2.0 installer
export PATH="/projdata3/info_fil/wangtao/conda/bin:$PATH"

can anyone help?有人可以帮忙吗? thanks very much!非常感谢!

Since you're using tcsh , not bash , you should edit your .cshrc and add the line:由于您使用的是tcsh ,而不是bash ,您应该编辑您的.cshrc并添加以下行:

set path = ( /projdata3/info_fil/wangtao/conda/bin $path )

Then use source .cshrc .然后使用source .cshrc

If your shell is .csh please use setenv to export a variable which in bash you would normally do with export如果您的 shell 是.csh请使用setenv导出一个变量,在 bash 中您通常会使用export

In bash , export My_VARIABLE=/some/location/or/.something/bashexport My_VARIABLE=/some/location/or/.something/

In csh shell, it would be setenv My_VARIABLE /some/location/or/.something/csh shell 中,它将是setenv My_VARIABLE /some/location/or/.something/

If echo $SHELL command is giving /usr/local/bin/tcsh then it means you are working in csh shell.如果echo $SHELL命令给出/usr/local/bin/tcsh则意味着您正在使用 csh shell。

In csh shell, if you want to set environment variables, the syntax goes like this在csh shell中,如果要设置环境变量,语法是这样的

setenv <variable_name> <variable_value>

Here is the useful csh commands link for reference这是有用的 csh 命令链接以供参考

If you want to enter bash shell from csh shell, enter command bash如果你想从 csh shell 进入bash shell,输入命令bash

Then this command will work: export <variable_name>=<variable_value>然后此命令将起作用: export <variable_name>=<variable_value>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM