In order to use environment variables inside Cygwin use the export command. To make this the default setting for a certain user, you can insert the necessary export command at the .bashrc
file that Cygwin read before each run. For more information, read this.
For example we need to make an environment variable named UBOOST
to point to a directory in our PC pointing to the Unix Boost Libraries. In my case, it is pointed at D:\data\boost_1_45_0\unix
. Using an editor that uses Unix end line formatting like Notepad++, Vi, Vim, Emacs or Nano edit the file named .bashrc
in your home directory and insert the following code under the Environment Variables
section of the file.
export UBOOST="D:\data\boost_1_45_0\unix"
In order to use this environment variable under Cygwin, use the following command.
cd $UBOOST
Make sure you type with the exact capitalization because Cygwin being Unix is strict on caps.
December 13, 2010 12:40 AM
.