
02-11-2009
|
|
Shell programmer, author
|
|
|
Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361
|
|
Quote:
Originally Posted by usfish
There is an interview question about UNIX bash:
Some shells like bash try to make '..' always work propery, namely, cd ../$USER will place you in your home directory. Does bash always get this behavior correct?
Anyway can provide any example that bash doesnt work well?
|
"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:
That will not work with a variable unless you use eval:
To go to your home directory, use cd with no directory.
|