LinuxQuestions.org
Help answer threads with 0 replies.
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 09-21-2003, 09:25 PM   #1
RHlinux9
LQ Newbie
 
Registered: Sep 2003
Posts: 28

Rep: Reputation: 15
bash???????


hi,
what is bash? it is a kind of shell yes this is what i read and can understand, BUT sometimes i get confused when using it
for example when i do export a variable
Quote:
export r=7
and then
Quote:
bash
i can find it exported
but when i login in another shell to see whether exported or not i can't find the variable
what is the difference between bash and opening a new shell ???? isn't bash supposed to open a new shell(session)???
why isn't variables exported through shells as with bash ???!!!!

thanks
 
Old 09-21-2003, 09:43 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,751

Rep: Reputation: 272Reputation: 272Reputation: 272
" i can find it exported
but when i login in another shell to see whether exported or not i can't find the variable"

When you export a variable that sets the variable for the current process and all subprocesses to the current process. It has no effect on parent processes or other users.
 
Old 09-21-2003, 09:47 PM   #3
eltongeoff
Member
 
Registered: Mar 2003
Posts: 76

Rep: Reputation: 15
whoa not too sure wut ur trying to pull there. but exporting a variable will set that variable for that particular session. when u start a new bash session your .bashrc file (in your home dir) is read and only the variables defined there r exported. if u want r to always equal 7, put export r='7' in your .bashrc file.

bash doesn't open a new shell, bash is the shell....... u can switch between shells, ie csh or tsch. not too sure wut u mean by open a new bash shell....... open a new terminal mebbe? then your .bashrc file gets sourced. and since export r='7' is not there, r no longer equals 7.
 
Old 09-22-2003, 06:13 AM   #4
RHlinux9
LQ Newbie
 
Registered: Sep 2003
Posts: 28

Original Poster
Rep: Reputation: 15
i mean by it wrtting bash and then enter while i am in a shell ( i wanna know what happens exactly when i do so, what i do open i this a new shell as bash is a kind of shell or is it .....?????)
 
Old 09-22-2003, 11:07 AM   #5
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,751

Rep: Reputation: 272Reputation: 272Reputation: 272
"is a kind of shell or is it .....?????"

It is a daemon, an independent entity running as its own thread. A daemon inherits the exported variables from its ancestral daemons. It knows nothing about exported variables in daemons running in parallel. This is a basic part of security. User knows nothing of variables exported by root and root knows nothing of variables set by user but both root and user know the values of variables exported by their common parent. The same idea holds true with daemons running within user space.

This holds true for any daemon. It is just easier to demonstrate with bash than it is with kwrite or abiword.
 
  


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
$LINENO can't be modified in bash 3.0, while it can be in bash 2.05b Darwish Linux - Software 1 11-07-2005 03:57 PM
bash my little bash alaios Linux - Newbie 4 01-11-2005 12:59 AM
bash + html + javascript or just bash ? rblampain Programming 4 12-01-2004 08:53 AM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 07:42 PM
Bash Half_Elf Linux - General 2 05-01-2002 07:39 PM


All times are GMT -5. The time now is 05:04 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