Re: without shell



In article <11aj9d3fga9or8b@xxxxxxxxxxxxxxxxxx>,
Grant Edwards <grante@xxxxxxxx> wrote:

> On 2005-06-10, Mage <mage@xxxxxxx> wrote:
>
> >>py> file_list = os.popen("ls").read()
> >>
> >>Stores the output of ls into file_list.
> >>
> > These commands invoke shell indeed.
>
> Under Unix, popen will not invoke a shell if it's passed a
> sequence rather than a single string.

I suspect you're thinking of the popen2 functions.
On UNIX, os.popen is posix.popen, is a simple wrapper
around the C library popen. It always invokes the
shell.

The no-shell alternatives are spawnv (instead of
system) and the popen2 family (given a sequence
of strings.)

Donn Cave, donn@xxxxxxxxxxxxxxxx
.



Relevant Pages

  • Re: without shell
    ... >>> These commands invoke shell indeed. ... >> sequence rather than a single string. ... > On UNIX, os.popen is posix.popen, is a simple wrapper around ...
    (comp.lang.python)
  • Re: without shell
    ... >>> These commands invoke shell indeed. ... > I suspect you're thinking of the popen2 functions. ... > On UNIX, os.popen is posix.popen, is a simple wrapper ...
    (comp.lang.python)
  • Re: Ada.Command_Line and wildcards
    ... with Unix design choices, that is "only" a shell thing and the shell ... I find it difficult to imagine Unix without the ...
    (comp.lang.ada)
  • Re: Ada.Command_Line and wildcards
    ... that is "only" a shell thing and the shell ... I find it difficult to imagine Unix without the ... And the shell is, I repeat, no programming language, but a ... When I mean Unix design choices, I mean Unix as it was planned, ...
    (comp.lang.ada)
  • Re: Ada.Command_Line and wildcards
    ... we had been talking about Unix design choices ... shell programming. ... There are shells that are based on established programming ...
    (comp.lang.ada)

Loading