LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 15
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:
/etc/profile

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
halturata
Member
 
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 :
Code:
# Set the path
PATH=/bin:/sbin:/usr/bin:/usr/sbin
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
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
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
xcore_on
Member
 
Registered: Mar 2006
Posts: 96

Original Poster
Rep: Reputation: 15
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
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,210

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Quote:
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.
 
  


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
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration