Analytics


Google

Friday, September 3, 2010

Setting path in Unix and Windows

Display path
In order to check on existing path, do the following:

in Windows, just type:
echo %path%

in Unix, just type 
echo $PATH

Set path
To add additional folder to the path, do the following:

in Windows, 
for example, to add c:\t2 to front of the path, just do type the following:

set path=c:\t2;%path%

in Unix, if we want to add /usr/sfw/bin to the front of the path, it is a two step process, type:

PATH=/usr/sfw/bin:$PATH
export PATH

to verify type the display path shown above.

Additional Note
A reminder, the paths are evaluated from left to write.  In both Windows and Unix, when we try to execute any program, it will first search for the application in the current folder, then it will traverse the path from left to right.

No comments: