I have a strange problem. I have a variable that I have exported in ~/.bashrc.
export NCARG_ROOT=/usr/local/ncl
In a terminal I can echo the variable, and it shows up correctly:
user@computer ~]$ echo $NCARG_ROOT
/usr/local/ncl
When I try to cd to it however, I get an error:
user@computer ~]$ cd $NCARG_ROOT
: No such file or directory.
The path (/usr/local/ncl) does indeed exist. It seems as though when the variable is executed it is empty to the shell (note that there should be something before the colon). Curiously a similar situation happens for the c-shell. I add the following line to the bottom of /etc/csh.cshrc and I get the same problem after switching shells:
setenv NCARG_ROOT /usr/local/ncl
changes shell
user@computer ~]$ cd $NCARG_ROOT
: No such file or directory
I have found a workaround. Adding the same export line to ~/.bash_profile seems to work. But by my understanding, this should work the way I originally had it, or am I missing something?
I am using Scientific Linux 6.10, which is a Red Hat Enterprise Linux rebuild.