LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-09-2006, 07:49 AM   #1
ctlqt12
LQ Newbie
 
Registered: May 2006
Posts: 2

Rep: Reputation: 0
create new environment variable


how to create new environment variable??
Example : when I type "env", i will see list of variables like HOME,TERM .... . So i want to set a new variable Dir="/root/Question"
And Dir variable will be display when i type "env"
 
Old 05-09-2006, 08:25 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
export Dir="/root/Question"

Last edited by Agrouf; 05-09-2006 at 08:38 AM.
 
Old 05-09-2006, 10:21 PM   #3
ctlqt12
LQ Newbie
 
Registered: May 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks. But after i restart computer, I type "env", DIR is not displayed. How do i solve it?
 
Old 05-09-2006, 11:28 PM   #4
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
you could add the command to your ~/.bash_profile file.. or create one and add it if it doesnt exist.
 
Old 05-10-2006, 02:56 AM   #5
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Or add it to the /etc/rc.d/rc.local file and it will be loaded everytime you start
 
Old 05-10-2006, 04:26 AM   #6
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
Quote:
Or add it to the /etc/rc.d/rc.local file and it will be loaded everytime you start
Er, no it won't. /etc/rc.d/rc.local is a boot script, it has nothing to do with a user's shell environment.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create new permanent environment variable in Red hat Linux? halturata Linux - Newbie 2 04-10-2006 10:38 AM
environment variable gamor Linux - Newbie 4 04-30-2005 05:28 PM
Environment Variable salmanucit Linux - Software 2 07-21-2004 02:27 AM
environment variable mimi Linux - Newbie 1 04-10-2002 08:29 AM
environment variable mimi Linux - General 2 04-10-2002 07:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:07 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration