[Scons-dev] Subprocess issue on Linux?
Gary Oberbrunner
garyo at oberbrunner.com
Wed Apr 2 10:31:39 EDT 2014
On Wed, Apr 2, 2014 at 4:16 AM, Tom Tanner (BLOOMBERG/ LONDON) <
ttanner2 at bloomberg.net> wrote:
> If you pass an array [ 'prog', '$TARGET', '$SOURCE' ] it doesn't execute a
> shell. Otherwise (passing a single string), it will examine for special
> characters, and if none are found it will split on white space and execute
> that, or it will pass that line to the shell.
>
> NB Yes, I realise this will potentially break things, but why execute a
> shell if you don't have to?
>
I don't think this would break anything. If the command has no shell
metachars (and we can be quite conservative about that), then executing it
directly vs. via a shell will be exactly the same, except for not needing
intervening shell process. In fact I thought SCons did this, many years
ago. I must be thinking of Perl though. :-) This technique can also be
used if a list is passed in; just check each word for shell metachars.
--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/scons-dev/attachments/20140402/767d58d8/attachment.html>
More information about the Scons-dev
mailing list