LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-10-2004, 12:10 PM   #1
anjaan
LQ Newbie
 
Registered: Aug 2003
Posts: 19

Rep: Reputation: 0
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.

Last edited by anjaan; 06-10-2004 at 12:11 PM.
 
Old 06-10-2004, 12:46 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
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.
 
Old 06-10-2004, 02:00 PM   #3
anjaan
LQ Newbie
 
Registered: Aug 2003
Posts: 19

Original Poster
Rep: Reputation: 0
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
 
Old 06-10-2004, 02:04 PM   #4
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 34
For cron you may have to declare the variable inside the script you run.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SLES: Why don't my environment variables get set? eantoranz Linux - Software 4 11-01-2005 11:49 AM
how do i set environment variables? guitarfella Slackware 2 12-04-2004 11:05 PM
Why can't my scripts set environment variables? Matthew3 Linux - Software 5 08-28-2004 05:26 PM
set environment variables using GUI? bax Linux - Software 2 04-10-2004 02:42 PM
Help with the currently set environment variables!! apoc013 Linux - Newbie 6 01-21-2004 01:28 AM


All times are GMT -5. The time now is 06:58 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration