[英]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/
在bash
, export 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.