1
$ export AMBERHOME=$AMBERHOME/home/rcibsd/amber14
$ cd $AMBERHOME
bash: cd: /home/rcibsd/home/rcibsd/amber14::/home/rcibsd/amber14:/home/rcibsd/amber14:/home/rcibsd/amber14:/home/rcibsd/amber14:/home/rcibsd/amber14: No such file or directory

What's wrong?

  • 1
    Close Voters, "unclear what you're asking"? What is unclear? – A.B. Jul 7 '15 at 14:23
3

The variable $AMBERHOME contains an invalid folder name. Therefore the command cd can't work.

Every time you run the command export AMBERHOME=$AMBERHOME/home/rcibsd/amber14, AMBERHOME will be set to the old value of AMBERHOME and the string /home/rcibsd/amber14

Example

% FOO="/bar"
% FOO="$FOO/bar"
% FOO="$FOO/bar"
% FOO="$FOO/bar"
% echo $FOO     
/bar/bar/bar/bar

Your special solution ;c)

  1. Edit the file .bashrc

    nano ~/.bashrc
    
  2. Add this line at the end of the file

    export AMBERHOME="/home/rcibsd/amber14"
    
  3. Save and close

    Ctrl+X and Y

  4. Open a new terminal

  5. Check the result

    echo $AMBERHOME
    

    Should be /home/rcibsd/amber14

    cd $AMBERHOME
    

    Should simply work

  • bashrc file was added with export AMBERHOME=$AMBERHOME/home/rcibsd/amber14 Temporarily it shows the path when typed cd $AMBERHOME but on reboot it doesnt, please suggest permanent setup. When I tried gksudo to edit the bashrc file, it shows the PATH however a message comes "No such file or directory". – Sunil Jul 7 '15 at 13:50
  • I don't know, what Amber is. – A.B. Jul 7 '15 at 13:55
  • @Sunil And as I said in my answer: export AMBERHOME="/home/rcibsd/amber14" – A.B. Jul 7 '15 at 13:59
  • Dear AB, I am new to Linux, I want to set AMBERHOME environment variable and I tried doing export AMBERHOME=/home/rcibsd/amber14. It works when I type cd $AMBERHOME, it shows PATH /rcibsd/amber14. But on reboot it dissapears. Hence I tried again to do it permanently by editing bashrc file in gksudo gedit command and now though it shows the PATH in repeats BUT also says No such file or directory. I tried your command as well but results are same. – Sunil Jul 7 '15 at 14:17
  • @Sunil =) See my improved answer :) – A.B. Jul 7 '15 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.