Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-09-2006, 08:49 AM   #1
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, 09:25 AM   #2
Senior Member
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

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

Last edited by Agrouf; 05-09-2006 at 09:38 AM.
Old 05-09-2006, 11:21 PM   #3
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-10-2006, 12:28 AM   #4
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, 03:56 AM   #5
Senior Member
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,286

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, 05:26 AM   #6
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

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


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 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 11:38 AM
environment variable gamor Linux - Newbie 4 04-30-2005 06:28 PM
Environment Variable salmanucit Linux - Software 2 07-21-2004 03:27 AM
environment variable mimi Linux - Newbie 1 04-10-2002 09:29 AM
environment variable mimi Linux - General 2 04-10-2002 08:45 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:31 PM.

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