Quote:
Originally Posted by
abbya
Hi all,when I cd to an environment variable "cd $MYDIR, if I type pwd, I don't the path to the environment variable dir I cd to.
But what else, instead?
Your request amounts to something like
when i add 1 to 1 i don't want the result to be 2.
When you set an environment variable "MYDIR" to some value, say, "/some/where" and you do a
cd $MYDIR you do - effectively - a
cd /some/where.
If you now issue the command
pwd, it will tell you the current directory you are in. In fact, this - to tell you the current directory you are in - is the very purpose of the command
pwd. And because you just changed to
/some/where before this current directory will invariably be
/some/where.
Just in case you meant the (enviroment variable)
$PWD (not "$pwd" - UNIX is case sensitive): this is a variable automatically maintained by many shells (ksh and bash among them) to always point to the same (current) directory, the command
pwd is displaying. For this, the same goes as i already said about the command. If you go to a certain location you are there - and because "location" is where you are, regardless of
where this is, it will be your location and your location will be where you are.
And, by the way, i would appreciate if you could come up with more telling thread titles. Maybe i am extra slow, but i couldn't glean any meaning from "$pwd".
I hope this helps.
bakunin