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!!! |
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 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. |
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 |
so, env show variables in /etc/profile and set show variables in /etc/bashrc!
this is true? |
Quote:
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. |
All times are GMT -5. The time now is 04:39 PM. |