ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986
Rep:
BASH Shell Differences: Login or Interactive
Intuitively I think that the Login Shell and the Interactive Shell are the same applications but have access to different environmental variables.It this true? Why is there more than one type of shell anyways? You can change users with the interactive shell, why not log on with it to?
Intuitively I think that the Login Shell and the Interactive Shell are the same applications but have access to different environmental variables.It this true?
No. Please check 'man bash', the "Invocation" part.
Quote:
Originally Posted by theKbStockpiler
Why is there more than one type of shell anyways?
Different tasks have different needs. After you initialized a login shell you don't want to keep logging in and some tasks, like starting a service or running an at or cronjob, run without terminal.
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986
Original Poster
Rep:
I read the whole section on Invocation and....
Thanks for the reply! I would like to establish that when I use the term (Application) I'm referring to a specific piece of software and not a (Process) , an instance of an application. I don't see anything in my specific BASH manual that seems to pertain to anything except BASH using different scripts for different purposes. There is no (BASH Login) application stored anywhere with another (Bash Script) application somewhere else is there? So the same BASH application is run in different processes with different Environmental Variables. Correct?
Intuitively I think that the Login Shell and the Interactive Shell are the same applications but have access to different environmental variables.
It is the same executable, but called with different arguments.
Quote:
-l
Make this shell act as if it had been directly invoked by login. When the shell is interactive, this is equivalent to starting a login shell with ‘exec -l bash’. When the shell is not interactive, the login shell startup files will be executed. ‘exec bash -l’ or ‘exec bash --login’ will replace the current shell with a Bash login shell. See Bash Startup Files, for a description of the special behavior of a login shell.
...
A login shell is one whose first character of argument zero is ‘-’, or one invoked with the --login option. Invoking Bash
Quote:
You can change users with the interactive shell, why not log on with it to?
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986
Original Poster
Rep:
Thanks for the help!
Quote:
What do you mean by change users?
I mean you can change from Root to which ever profile that was created on your computer.
Quote:
[kbs@localhost ~]$ su
Password:
[root@localhost kbs]#
I assume that the login shell is the one that allows you to enter your user password for your own profile. I don't mean to be redundant in a facetious way but I don't get the confusion. Thanks again!
I mean you can change from Root to which ever profile that was created on your computer.I assume that the login shell is the one that allows you to enter your user password for your own profile. I don't mean to be redundant in a facetious way but I don't get the confusion. Thanks again!
No, the su program asks for the password. If you are root, su won't ask for a password, it doesn't matter whether you are running a login shell or not. Don't worry about being redundant, I'm still not entirely sure I've understood your question.
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986
Original Poster
Rep:
It's all academic at this point. "Is that the correct saying?
I don't see the reasoning behind having more than one process of BASH run at the same time.I would think that how the instances of Bash access and store data could be handled some other way besides for isolating them to keep them separate. I do understand it enough and it is not all that important but I would be interested in knowing because I'm studying it at the present.
Thanks!
Last edited by theKbStockpiler; 02-20-2011 at 01:30 PM.
I don't see the reasoning behind having more than one process of BASH run at the same time.
Um, if you start a second bash process you will have two processes running at the same time, I'm not sure what kind of "reasoning" you are looking for here...
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986
Original Poster
Rep:
Its not important . You have helped solve this thread and just to cure your curiosity.
Two separate processes running the same code with different Environmental Variables and storage files for all of these. This is too in-depth for most purposes but is the reasoning behind the question.
Two separate processes running the same code with different Environmental Variables and storage files for all of these. This is too in-depth for most purposes but is the reasoning behind the question.
Not really. About having different storage files you just have to separate working directories based from the process' PID. i.e.:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.