On 3/11/10 9:10 AM, Robert Cratchit wrote:
> On page
>
> http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files
>
> Could this sentence:
>
> "An interactive shell is one started without non-option arguments,
> unless -sis specified, without specifying the
> -c option, and whose input and error output are both connected to terminals
> (as determined by isatty(3)), or one started with the -i option. "
>
> be any more confusing?
Let's rearrange the clauses a bit and add some explanation and see if
that clears things up.
if the -i option is supplied, the shell is interactive
Otherwise, the shell is interactive unless:
if the -c option is supplied, the shell is not interactive;
bash -c anything is not interactive, even in the presence of
other arguments like -s
or if any non-option arguments are supplied without also using -s the
shell is not interactive;
unless you use -s, any other args are assumed to be a script
file and its arguments
or if the shell's stdin and stderr are not terminals, the shell is
not interactive;
bash < xxx is not interactive, though it's strange that
bash > foo can be interactive
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/