I have observed that only the values of exported variables are appended to the my PATH variable via my Mac OS X .bash_profile
. Whereas, the values of locally set variables cannot. Why can't local variables be appended to the path?
“You've misinterpreted something, but what? Post the code that puzzles you. – Gilles yesterday”
Please consider this snippet, where I set the MONGODB variable as:
set MONGODB="/usr/local/mongodb/bin"
export PATH=${PATH}:${MONGODB}
I source .bash_profile
in terminal.
I see the following echo:
PATH=~/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:
Whereas, if I export MONGODB instead, and source my .bash_profile
, I see the following echo:
PATH=~/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mongodb/bin
Perhaps, using set
is improper?
export
ing variables is to make them available outside of the current shell. Could you show what you're trying to do? WhatPATH
expression isn't working? How are you starting the new shell? – geekosaur Mar 14 '11 at 21:51