LinuxQuestions.org
Visit Jeremy's Blog.
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 12-27-2007, 02:10 AM   #1
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Rep: Reputation: 30
Question 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
 
Old 12-27-2007, 02:18 AM   #2
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 60
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.
 
Old 12-27-2007, 02:25 AM   #3
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
thanks

Quote:
From Google I can only guess that it's some flavor of RedHat.
Quote:
I assume, it's bash.

u r assumptions are perfectly right
 
Old 12-27-2007, 02:27 AM   #4
roy_lt_69
Member
 
Registered: Aug 2006
Location: Vancouver, BC, Canada
Distribution: Slackware, Bodhi, Mint-xfce
Posts: 182

Rep: Reputation: 21
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?
 
Old 12-27-2007, 02:35 AM   #5
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
yes
i am looking for the variable "sdf"
 
Old 12-27-2007, 12:40 PM   #6
joel2001k
Member
 
Registered: Mar 2007
Distribution: GNU/Linux debian unstable main
Posts: 92

Rep: Reputation: 17
try

`declare | less`
 
Old 12-28-2007, 04:41 AM   #7
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
Quote:
try

`declare | less`
thats great
where can i find the file which stores all these values
 
Old 12-28-2007, 10:16 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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.
 
Old 12-30-2007, 09:22 PM   #9
roy_lt_69
Member
 
Registered: Aug 2006
Location: Vancouver, BC, Canada
Distribution: Slackware, Bodhi, Mint-xfce
Posts: 182

Rep: Reputation: 21
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).
 
  


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
shell script variables Gary_Menegon Programming 1 10-02-2006 10:28 AM
Shell variables Milosevic Linux - Newbie 2 12-10-2005 11:32 PM
Variables in Make file do not expand in shell? realos Programming 5 08-07-2005 06:16 AM
Why?? can not use variables with shell script Bassam Linux - General 9 01-27-2004 08:42 AM
Shell Variables. ducka Programming 5 09-03-2003 06:38 PM


All times are GMT -5. The time now is 12:47 AM.

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