You might want to read the man page for bash and search (type "/" followed by the keyword) for INVOCATION. I think you might be mistaken about the function of the .bashrc file. Perhaps you want the .bash_login file. Reading the /etc/bash.bashrc file might provide some enlightenment. If the bash script is not connected to a terminal, i.e. not interactive, then other rules apply.
That notwithstanding, if you are executing the .bashrc file instead of including it using the "." or dot command, then you won't see the variable unless set somewhere else directly in the code.
To see what variables and options are set in a terminal, type "set" and enter.
Last edited by turtlegeek; 02-27-2011 at 04:53 PM.
Reason: adding a hint
|