Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 1st April 2008, 07:11 AM
phe Offline
Registered User
 
Join Date: Nov 2006
Location: halleatbe
Posts: 360
Display all environment variables

Hello,

Does there exists in Linux an equivalent of the dos instruction "set".

When you type in set without any argument, it displays all environment variables that actually exists with theire values.
This is also applicable in XP dos-boxes.

I want to check what environment variables are actually set in my Linux (Fedora 8)
Reply With Quote
  #2  
Old 1st April 2008, 07:15 AM
Hlingler's Avatar
Hlingler Offline
Administrator
 
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,289
declare

V
Reply With Quote
  #3  
Old 1st April 2008, 07:15 AM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
funnily enough it's
Code:
set


at least in bash
Reply With Quote
  #4  
Old 1st April 2008, 12:39 PM
philippe_PMA Offline
Registered User
 
Join Date: Mar 2008
Posts: 48
With bash and family (sh, ksh, etc), you can use :

Code:
env
__________________
My english is bad ? Yes i am french :)
Reply With Quote
  #5  
Old 1st April 2008, 01:28 PM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
Quote:
Originally Posted by philippe_PMA
With bash and family (sh, ksh, etc), you can use :

Code:
env
That's actually a more accurate answer to the OP's question, since set/declare list shell variables also (these variables are specific to the bash shell not a particular user environment), and also list shell functions if any are defined.

But It depends what you're looking for, env variables are passed to child processes, shell variables are not (but will be used if the shell is used in the child process obviously)
Reply With Quote
  #6  
Old 4th April 2008, 10:06 AM
phe Offline
Registered User
 
Join Date: Nov 2006
Location: halleatbe
Posts: 360
env
set
declare

these 3 gives 3 different outputs ! ? ? ? ?
Reply With Quote
  #7  
Old 4th April 2008, 10:19 AM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
set & declare give the same output in bash (apart from a trivial difference regarding the 'last command' variable)

Code:
$ set > set
$ declare > declare
$ diff set declare
78c78
< _=-
---
> _=set
$
env just lists environment variables, which are a subset of all the bash shell variables (when bash starts a shell it sets its own shell variables and then sets every environment variable (for the user) to be an (uppercase) shell variable, so no real distinction between env and shell variables in bash)
Reply With Quote
Reply

Tags
display, environment, variables

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wine environment variables Deonis Using Fedora 1 1st April 2009 08:43 PM
Environment Variables nightmarcus Using Fedora 5 20th January 2009 11:31 AM
Environment Variables Curtor Using Fedora 4 14th February 2008 08:01 PM
environment variables? hari_mj23 Using Fedora 9 3rd April 2006 07:03 AM
Environment variables Flatron Using Fedora 7 28th January 2006 02:47 AM


Current GMT-time: 13:28 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat