LinuxQuestions.org
Review your favorite Linux distribution.
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 03-20-2008, 06:10 PM   #1
linux_linux
Member
 
Registered: Mar 2008
Posts: 52

Rep: Reputation: 15
Environment Variable


It seems as a simple question for u , how can we set an environment variable ?
many thanks in advance
 
Old 03-20-2008, 06:17 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
Which environment variable are you referring to?
Usually use the export command.

Brian
 
Old 03-20-2008, 06:18 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
variable=value

was that simple enough? maybe you actually mean something you're not asking? how to make it globally accessible on boot? add it to /etc/rc.local as "export variable=value" and once booted that variable will be everywhere.
 
Old 03-20-2008, 06:21 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,750

Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by linux_linux View Post

It seems as a simple question for u , how can we set an environment variable ?
many thanks in advance
You set an environment variable from the command line using an = sign. For example:

KLMNO=123456

both creates KLMNO and sets the value of KLMNO to 123456. If you want to know the current values of your existing environment variables use this command:

printenv

You can find out the value of an individual environment variable with the echo command:

echo $KLMNO

----------------------
Steve Stites
 
Old 03-20-2008, 11:16 PM   #5
prad77
Member
 
Registered: Mar 2008
Posts: 101

Rep: Reputation: 15
It can be done by simple substitution, export or adding in your .profile.

http://lowfatlinux.com/linux-environment-variables.html

Fedora Development

Last edited by prad77; 04-17-2008 at 04:18 AM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Environment variable vedanu Programming 1 05-17-2007 08:20 AM
Environment variable.. manomohan Programming 1 02-27-2007 12:27 AM
environment variable gamor Linux - Newbie 4 04-30-2005 06:28 PM
environment variable mimi Linux - Newbie 1 04-10-2002 09:29 AM
environment variable mimi Linux - General 2 04-10-2002 08:45 AM


All times are GMT -5. The time now is 06:38 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration