Date: Fri, 27 Oct 2000 08:20:16 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: pjfarley AT banet DOT net Message-Id: <2950-Fri27Oct2000082016+0200-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.5h CC: djgpp-workers AT delorie DOT com, snowball3 AT bigfoot DOT com In-reply-to: <4.3.1.0.20001026195212.00b2d270@pop5.banet.net> (pjfarley AT banet DOT net) Subject: Re: Bash 2.04 beta 6a References: <4 DOT 3 DOT 1 DOT 0 DOT 20001025221409 DOT 00ad89b0 AT pop5 DOT banet DOT net> <4 DOT 3 DOT 1 DOT 0 DOT 20001023205604 DOT 00b0edf0 AT pop5 DOT banet DOT net> <39F47A27 DOT 20049 DOT BA7D8C AT localhost> <4 DOT 3 DOT 1 DOT 0 DOT 20001025221409 DOT 00ad89b0 AT pop5 DOT banet DOT net> <4 DOT 3 DOT 1 DOT 0 DOT 20001026195212 DOT 00b2d270 AT pop5 DOT banet DOT net> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Thu, 26 Oct 2000 20:13:22 -0400 > From: "Peter J. Farley III" > > Well, on the Linux I have available, using the "-c" option gave the > same results as running it through a shell script. That would justify a question to Perl gurus on Unix about how does this work at all. > I do wonder, does DJGPP's bash thinks it is being run interactively > when invoked from system()? From the Bash docs: An interactive shell is one whose standard input and out- put are both connected to terminals (as determined by isatty(3)), or one started with the -i option. PS1 is set and $- includes i if bash is interactive, allowing a shell script or a startup file to test this state. So it should run as an interactive shell, unless Perl redirects its standard handles, and you should be able to see whether it is interactive by looking at PS1 and $-. It is possible that, if the DJGPP port of Perl redirects the standard handles, but the Unix code uses the pipe() system call, the effect is different. However, I don't think that pipe()'ed handles return non-zero from isatty(). > Maybe the shell needs to be told it is being run non-interactively? The question is: how does the Unix version tell Bash it's non-interactive? If we know that, we could think how to do that with DJGPP.