I know what is a login shell and the difference between a login shell and a non-login shell.
But what puzzles me is how it is invoked. It is said that a login shell is invoked with a
- as argument 0.
How can we pass an argument to a shell that is being invoked, then argument 0 is the name of the shell itself?
# -bash -bash: -bash: command not found
# bash --login # echo $0 # bash
I still don't see a
Only when I SSH in, then I am able to see a
-bash when issuing
But back to my original question,
- how does Unix/Linux create a login shell ?
- What is the "thing" that creates a login shell during the login process? If it is a "login" process that invokes the bash shell during login, how does it pass argument 0 as
-to the bash shell?