Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-20-2006, 05:14 AM   #1
Registered: Mar 2006
Posts: 96

Rep: Reputation: 16
set and env show values of what file(s)?

hello all,

the commands "set" and "env" get and show values of what files?

I have read than:

set get and show values of:
/etc/bashrc (or /etc/bash.bashrc)

env get and show values of:

But this not is very true in my distro's:
-Debian 3.1r1 (kernel 2.4.27-2-386)
-Fedora Core 5 (kernel 2.6.15-1.2054_FC5)

have much more informations show in this commands.
so, "set" and "env" get and show values of what files?

thanks in advance!!!

Last edited by xcore_on; 04-20-2006 at 05:27 AM.
Old 04-20-2006, 09:36 AM   #2
Registered: Aug 2005
Location: Sofia
Distribution: SuSE, ELinOS
Posts: 100

Rep: Reputation: 16
The files you mention (/etc/bashrc and /etc/profile) are read at boot-time and somewher in them the env variables are exported. Further in /etc/rc.d/rc/sysinit the "foundations" of PATH are build with :
# Set the path
export PATH

... and many more ...
somewhere in the beginning of the file. Perhaps that is the part you are looking for.
In addition some of the scritps in /etc/rc.d/rcX.d may start services which export their own env variables.

P.S. The above paths are taken from Red hat disto, I don't know if they are the same for Fedora and Debian.

Last edited by halturata; 04-20-2006 at 09:40 AM.
Old 04-21-2006, 12:48 AM   #3
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,590

Rep: Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434
Actually, they show the current environment variables (hence 'env'). Scripts/progs can add to the env using alis cmd eg
alias vi=vim
use export cmd to ensure definitions are carried down into sub-shells eg
export vi
Old 05-30-2006, 05:43 PM   #4
Registered: Mar 2006
Posts: 96

Original Poster
Rep: Reputation: 16
so, env show variables in /etc/profile and set show variables in /etc/bashrc!

this is true?
Old 05-30-2006, 06:16 PM   #5
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,277

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Originally Posted by xcore_on
so, env show variables in /etc/profile and set show variables in /etc/bashrc!

this is true?
No. env shows your current environment. Things can get into your environment in different ways. /etc/profile is one way to set them. /etc/bashrc is another way. You can set them manually.

The closest "file" you can come to that contains your enviroment, is /proc/<pid>/environ, where "<pid>" is replaced by the actual process_id of your current shell.


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
set Versus env Echo Kilo Linux - General 2 06-09-2009 03:56 AM
Cannot set LD_LIBRARY_PATH in .cshrc (able to set other env variables) senthilpr_in Linux - Newbie 4 02-26-2007 01:46 PM
phpinfo wont show updated values..Why??? Help rajnair0278 Linux - Software 13 03-22-2006 05:21 AM
How to test if an env variable is set King of Men Linux - Newbie 5 11-03-2005 05:39 AM
set or env? calutateo Linux - Newbie 2 07-24-2005 01:56 PM > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration