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, 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
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,419

Rep: Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785
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 / openSUSE 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

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