How to edit .bashrc such that I don't need to export on every new session?
I want something like
Code:
export ROS_PACKAGE_PATH=~/ros:$ROS_PACKAGE_PATH |
Insert the line as is at the bottom of ~/.bashrc should do the trick I think.
|
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. |
Oops, forgot to respond to this. Adding it to the end of the bashrc file does work thanks.
However, after looking more into the bash stuff I understand that using the bash_login is probably a better choice. It wasn't working when I tried it just recently though. I know it's the correct way, but I'll fix it when I have more time to tweak things. Thanks to both of you! |
All times are GMT -5. The time now is 01:14 AM. |