How to set environment variables
Hi all, I would like to set up an environment variable under SuSe Linux. What would be root's startup file. .profile and .bash_profile don't exist. Any help is appreciated. Thanks.
|
For bash, there primarily four files to look at:
/etc/profile /etc/bashrc ~/.bash_profile ~/.bashrc You can modify any of them to export the variable. For the files located in /etc, the changes will be included for every user. For the files in ~/, the chages will only be for that particular user. If the file doesn't exist, just create one adding whatever necesssary commands with a text editor and save it. Then re-log (or source the file) to have the changes take effect. |
Thanks very much :)
One last question. Lets say running some script requires running a variable first. Doest that mean that I need to run that variable (by adding to /etc/profile for example) for crontab as well? Does cron require you to run a variable? Where would I specify the same variable for cron? Thanks in advance |
For cron you may have to declare the variable inside the script you run.
|
All times are GMT -5. The time now is 10:02 PM. |