CDPATH in bash
What does CDPATH do? It provides a shortcut to bash to change directory. For example, there is
a working directory called
/home/user/abc/efg/hik/lmn/123/456/
under which there are dir1, dir2, dir4..etc
To change directory, one has to type cd /home/user/abc/efg/hik/lmn/123/456/dir1 to get to dir1. This can be aggravating as one can imagine. CDPATH is a envrionment setting for bash such that one can set it up as export CDPATH=/home/user/abc/efg/hik/lmn/123/456/, next time one just needs to type cd dir1 to get to dir1, so on and so forth.
However, this setting can interfere with GNU make system. Or any non-interactive script that has cd command inside. It's recommended that one 'unset CDPATH' before 'make' or long hours of head scratching can follow.
a working directory called
/home/user/abc/efg/hik/lmn/123/456/
under which there are dir1, dir2, dir4..etc
To change directory, one has to type cd /home/user/abc/efg/hik/lmn/123/456/dir1 to get to dir1. This can be aggravating as one can imagine. CDPATH is a envrionment setting for bash such that one can set it up as export CDPATH=/home/user/abc/efg/hik/lmn/123/456/, next time one just needs to type cd dir1 to get to dir1, so on and so forth.
However, this setting can interfere with GNU make system. Or any non-interactive script that has cd command inside. It's recommended that one 'unset CDPATH' before 'make' or long hours of head scratching can follow.
<< Home