Meditation, The Art of Exploitation

Thinking? At last I have discovered it--thought; this alone is inseparable from me. I am, I exist--that is certain. But for how long? For as long as I am thinking. For it could be, that were I totally to cease from thinking, I should totally cease to exist....I am, then, in the strict sense only a thing that thinks.

Wednesday, June 13, 2007

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.