В Пнд, 12/05/2008 в 17:02 -0600, Bob Proulx пишет:

> The $0 is the name used to invoke the shell.  If it starts with a '-'
> then this is used to instruct the shell that it is a login shell.  The
> second variable $- is the flags set to the shell.  The 'i' for
> interactive should be in there.

Actually that's not exactly true. It's possible to start bash as login
shell but - will be absent. Quoting relevant part of manual:

"A _login_ shell is one whose first character of argument zero is `-',
or one invoked with the `--login' option."

Better way to check if shell is login is:

 $ shopt | grep login_shell
login_shell     on

-- 
Peter.



Reply via email to