LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 10: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, 11:17 AM   #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 11:18 AM.
 
Old 12-13-2006, 06:33 PM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

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


All times are GMT -5. The time now is 05:42 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