www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/10/29/01:19:24

Date: Sun, 29 Oct 2000 08:17:33 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Peter J. Farley III" <pjfarley AT banet DOT net>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Bash 2.04 beta 6a
In-Reply-To: <4.3.1.0.20001028153622.00b18a90@pop5.banet.net>
Message-ID: <Pine.SUN.3.91.1001029080733.3725A-100000@is>
MIME-Version: 1.0
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

On Sat, 28 Oct 2000, Peter J. Farley III wrote:

> At 09:25 AM 10/28/00 +0200, Eli Zaretskii wrote:
> <Snipped>
>  >Note that popen/pclose from our libc also redirect handles with
>  >dup/dup2 and call system() to run the subsidiary program.
> 
> I guess Laszlo put those in before the current popen/pclose were 
> available.

I doubt that: our popen/pclose is mostly unchanged from what was released 
with v2.0.

> Better, I think, if we try to use what's in libc, so that 
> future changes aren't lost to perl.  I'll try removing his 
> perl-specific versions and make sure everything still works.

I'd suggest to as Laszlo first, in cased there's a good reason for what 
he did.

> If it turns out we need to use "exec("sh -c 'command...'")" or 
> "spawn...("sh -c 'command...'")" to duplicate *ix behavior, then I can 
> put the special versions into perl only, leaving libc alone.

The only difference between the above and what libc does now is the -c 
switch.  If that's the important difference, you could always say 
popen("sh -c 'command...'", ...) instead of just popen("command", ...).

Note that by forcing "sh" into popen you force Perl users to install 
Bash, even if the commands they use don't require Bash.  I don't know 
whether this is a problem.

> Is there any way (at present) to override system()'s use of "bash 
> tmpfile" or "sh tmpfile", say if the command line is short enough to 
> stay within DOS commandline limits?

Before you embark on that journey, let's be sure this is what causes the 
different behavior.  There are good reasons for the way `system' calls a 
Unixy shell (I forget the details, but the comments there say something 
about here-documents).

> What about just for power users 
> who have set up CONFIG.SYS to use the "command.com" switch 
> "/u:255"?  I'd bet there is a way to determine if that was done 
> *somewhere* in the DOS internals.

Don't bet: you'd lose ;-).

> I still have not determined just exactly how 
> perl implements open(fh, "echo #foo|"), so we are still lacking 
> critical information needed to determine a path to take.

Yes.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019