[NTLUG:Discuss] Login Shell
Chris Cox
cjcox at acm.org
Sat Dec 22 17:11:57 CST 2001
Login shells often start with a "-" as the argv[0] to exec.
Look at $0 in the shell.
$ echo $0
Regards,
Chris
Bug Hunter wrote:
>
> I am not certain, but I think the problem is that the process that
> spawns the login shell is the one that get the environment variable set.
> The "export" causes the environment variable to be carried into the login
> shell.
>
> Try putting the environment variable in the other .bash script files, such
> as .bashrc
>
> bug
>
> On Fri, 21 Dec 2001, Sameer Khan wrote:
>
> > I'm trying to figure out how to distinguish a login shell
> > from a non-login shell. If an environment variable is set in
> > ~/.bash_profile (e.g. LOGIN_SHELL=true), but not exported,
> > it should logically only appear in a login shell and not a
> > subshell or non-login shell. But, it doesn't show up in any
> > shell. Anybody wrestled with this problem before?
> > Thanks
> >
> > _______________________________________________
> > http://www.ntlug.org/mailman/listinfo/discuss
> >
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
More information about the Discuss
mailing list