Fredrik Lundh wrote:
> Clodoaldo Pinto Neto wrote:
>
> > But I still don't understand what is happening. The manual says that
> > when shell=True the executable argument specifies which shell to use:
>
> no, it says that when shell=True, it runs the command "through" the
> default shell. that is,
Clodoaldo Pinto Neto wrote:
> But I still don't understand what is happening. The manual says that
> when shell=True the executable argument specifies which shell to use:
no, it says that when shell=True, it runs the command "through" the
default shell. that is, it hands it over to the shell fo
Fredrik Lundh wrote:
> [EMAIL PROTECTED] wrote:
>
> > I can't see any obvious way to ask subprocess to use a shell other than
> > the default.
>
> -c ?
>
> >>> f = Popen(["/bin/bash", "-c", "set|grep IFS"], stdout=PIPE)
> >>> f.stdout.read()
> "IFS=$' \\t\\n'\n"
> >>> f = Popen(["/bin/sh", "-c",
[EMAIL PROTECTED] wrote:
> I can't see any obvious way to ask subprocess to use a shell other than
> the default.
-c ?
>>> f = Popen(["/bin/bash", "-c", "set|grep IFS"], stdout=PIPE)
>>> f.stdout.read()
"IFS=$' \\t\\n'\n"
>>> f = Popen(["/bin/sh", "-c", "set|grep IFS"], stdout=PIPE)
>>> f.st
Clodoaldo Pinto Neto wrote:
> Output from the shell:
>
> [EMAIL PROTECTED] teste]$ set | grep IFS
> IFS=$' \t\n'
>
> Output from subprocess.Popen():
>
> >>> import subprocess as sub
> >>> p = sub.Popen('set | grep IFS', shell=T
Now we have 3 different outputs from 3 people to the command:
>>> f = subprocess.Popen("set | grep IFS", shell=True,
stdout=subprocess.PIPE)
>>> f.stdout.readlines()
>From me on FC5:
["BASH_EXECUTION_STRING='set | grep IFS'\n", "IFS=' \t\n"]
>From Fredrik Lundh on unknown
Clodoaldo Pinto Neto <[EMAIL PROTECTED]> wrote:
>Fredrik Lundh wrote:
>> this works for me:
>>
>> >>> f = subprocess.Popen("set | grep IFS", shell=True,
>> stdout=subprocess.PIPE)
>> >>> f.stdout.readlines()
>> ["IFS=$' \\t\\n'\n"]
>>
>> what does the above return on your machine?
>
f = subp
Fredrik Lundh wrote:
> this works for me:
>
> >>> f = subprocess.Popen("set | grep IFS", shell=True,
> stdout=subprocess.PIPE)
> >>> f.stdout.readlines()
> ["IFS=$' \\t\\n'\n"]
>
> what does the above return on your machine?
>>> f = subprocess.Popen("set | grep IFS", shell=True, stdout=subproce
Clodoaldo Pinto Neto wrote:
> Output from the shell:
>
> [EMAIL PROTECTED] teste]$ set | grep IFS
> IFS=$' \t\n'
>
> Output from subprocess.Popen():
>
>>>> import subprocess as sub
>>>> p = sub.Popen('set | grep IFS', shell=
Output from the shell:
[EMAIL PROTECTED] teste]$ set | grep IFS
IFS=$' \t\n'
Output from subprocess.Popen():
>>> import subprocess as sub
>>> p = sub.Popen('set | grep IFS', shell=True, stdout=sub.PIPE)
>>> p.stdout.readlines()[1]
"IFS=
10 matches
Mail list logo