bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash manual - interactive shell definition


From: Chet Ramey
Subject: Re: Bash manual - interactive shell definition
Date: Fri, 12 Mar 2010 13:53:29 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20100111 Lightning/1.0b1 Thunderbird/3.0.1

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    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]