I wanted to use the Python installed under cygwin rather than one installed under WinXP directly, so I edited ~/.bashrc and sourced it. Nothing changed. I tried other things, but nothing I did changed $PATH in any way. So I rebooted. Aha; now $PATH has changed to what I wanted.
But, can anyone explain WHY this happened? When do changes to the environment (and its variables) made via cygwin (and bash) take effect only after a reboot?
(Is this any way to run a railroad?) (This question is unlikely to win any points, but I'm curious, and I'm also tired of wading through docs which don't help on this point.)
Try:
PATH="${PATH}:${PYTHON}"; export PATH
Or:
export PATH="${PATH}:${PYTHON}"
the quotes preserve the spaces and newlines that you don't have in your directory names. I repeat "don't".
If you want to change the path for the current environment and any subsequent processes, use something similar to either of the commands above; they are equivalent.
If you want to change the path for the next time you start Bash, edit ~/.bashrc
and add one of the above (for example) or edit the existing PATH
setting command that you find there.
If you want to affect both the current environment and any subsequent ones (i.e. have an immediate and a "permanent" affect), edit ~/.bashrc
and do one of the following: type one of the first two forms shown above or source the ~/.bashrc
file. Sometimes, you may not want to do the sourcing if, for example, it would undo some temporary thing that you're making use of currently like have some other variables set differently than ~/.bashrc
would set (reset) them to.
I don't think you need to worry about hash unless you're either doing some serious rearranging or adding some local replacements for system utilities perhaps.