The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 02-11-2009
usfish usfish is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 2
Quote:
Originally Posted by cfajohnson View Post

"cd ../$USER" will not place you in your home directory unless you are in a directory on the same level as your home directory.

You may be thinking of:


Code:
cd ~user

That will not work with a variable unless you use eval:


Code:
eval "cd ~$USER"

To go to your home directory, use cd with no directory.
Hi, thank you for your prompt response. I missed that condition. It is from the home directory and you type "..", and they meant to ask about ".." instead of $USER I guess.

I think there might be chance that bash fails on symbolic link?