Closed edooarda closed 2 days ago
Remove the variable from the env and the value of the variable
Ex: re@f1r6s9:~$ env | grep "PWD" PWD=/home/re OLDPWD=/home/re re@f1r6s9:~$ pwd /home/re re@f1r6s9:~$ unset PWD re@f1r6s9:~$ env | grep "PWD" OLDPWD=/home/re re@f1r6s9:~$ cd Documents/ re@f1r6s9:~/Documents$ pwd /home/re/Documents re@f1r6s9:~/Documents$ env | grep "PWD" re@f1r6s9:~/Documents$ echo $PWD /home/re/Documents re@f1r6s9:~/Documents$ unset PWD re@f1r6s9:~/Documents$ echo $PWD
re@f1r6s9:~/Documents$
The old PWD from the env list will receive no value when the PWD was unset and changed the folder
If it is export again, it gets automatic the value of the cwd.
Remove the variable from the env and the value of the variable
Ex: re@f1r6s9:~$ env | grep "PWD" PWD=/home/re OLDPWD=/home/re re@f1r6s9:~$ pwd /home/re re@f1r6s9:~$ unset PWD re@f1r6s9:~$ env | grep "PWD" OLDPWD=/home/re re@f1r6s9:~$ cd Documents/ re@f1r6s9:~/Documents$ pwd /home/re/Documents re@f1r6s9:~/Documents$ env | grep "PWD" re@f1r6s9:~/Documents$ echo $PWD /home/re/Documents re@f1r6s9:~/Documents$ unset PWD re@f1r6s9:~/Documents$ echo $PWD
re@f1r6s9:~/Documents$