which file contains shell variables
hi
which file contains the shell variables.i am using the following distrubution. [bala@localhost ~]$ uname -a Linux localhost.localdomain 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686 i686 i386 GNU/Linux |
Well, first of all, the information you give doesn't say what distro you're using. :)
From Google I can only guess that it's some flavor of RedHat. Then, the place where the shell variables are set depends on the shell. I assume, it's bash. Then, some variables are set in /etc/profile, some come from .bashrc and .bash_profile in your home directory if they are present. You might want to read man bash, the INVOCATION part, it explains the rest. |
thanks
Quote:
Quote:
u r assumptions are perfectly right;) |
There is no one file that contains all the shell variables.
But alot of them are set in /etc and its sub-directories, some can also be user specific (ie see ~ hidden files/directories). Is there a specific variable you are looking for? |
yes
i am looking for the variable "sdf" |
try
`declare | less` |
Quote:
where can i find the file which stores all these values |
Use ps -e to get the PID for bash. Then go to /proc/<PID>/ and do "more environ". This LOOKS like a file, but it's not. It is a structure in memory. What you see in /proc is "virtual files" that point to things in RAM.
|
Maybe you should run a grep for the variable 'sdf' (what is this variable for anyways?) in /etc, and in your home directory.
But there is no guarantee it is set in those places (or sub-directories). |
All times are GMT -5. The time now is 05:57 PM. |