LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices



Reply
 
Search this Thread
Old 12-13-2006, 11:59 AM   #1
Sulman Shah
Member
 
Registered: Oct 2006
Posts: 38

Rep: Reputation: 15
Setting and getting environment variables???


Dear All,

I am new to linux and just want to know that how many different types of environment variables are there in linux. How do we set and get their values? How will we the environment path of a library to a different one? i mean to say how can we change it?

--Kind regards,
Sulman
 
Old 12-13-2006, 12:17 PM   #2
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
You can for example use:

Code:
printenv
Will print the environment variables

Code:
export VARNAME=varvalue
Can be used to set an environment variable

Last edited by fordeck; 12-13-2006 at 12:18 PM.
 
Old 12-13-2006, 07:33 PM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Other cmds are:
set
env
both will show env vars.
Incidentally, 'export' is only required if you want the value to be passed down to sub-shells of the assigning shell.
Otherwise, simple assignment is sufficient.
 
  


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
setting environment variables v333k Linux - Newbie 5 06-27-2006 04:15 PM
Environment variables setting... simjii Suse/Novell 4 11-19-2005 08:50 PM
Need help setting environment variables. cottonmouth Linux - Newbie 3 12-09-2004 05:54 PM
setting environment variables durden2.0 Linux - Newbie 5 07-15-2003 02:57 PM
setting environment variables rezza Linux - Distributions 2 04-09-2003 09:21 AM


All times are GMT -5. The time now is 06:15 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration