The problem is that $PWD is the variable that contains the CURRENT WORKING DIRECTORY, which measn that if you are in /home and you cd to $PWD what you are actually saying is cd /home... which obviously will leave you in the same place.
ex:
Quote:
[~/Desktop]$ echo $PWD
/home/raptorx/Desktop
[~/Desktop]$ cd $PWD
[~/Desktop]$ echo $?
0
[~/Desktop]$
|
you can see that the cd command exits with code 0, which means that it worked fine... but we stay in the same directory for obvious reasons.