LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bash??????? (https://www.linuxquestions.org/questions/linux-newbie-8/bash-95308/)

RHlinux9 09-21-2003 08:25 PM

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

jailbait 09-21-2003 08:43 PM

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

eltongeoff 09-21-2003 08:47 PM

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.

RHlinux9 09-22-2003 05:13 AM

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 .....?????)

jailbait 09-22-2003 10:07 AM

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


All times are GMT -5. The time now is 01:54 PM.