Re: Output from subprocess.Popen()

2006-10-17 Thread Clodoaldo Pinto Neto
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,

Re: Output from subprocess.Popen()

2006-10-16 Thread Fredrik Lundh
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

Re: Output from subprocess.Popen()

2006-10-16 Thread Clodoaldo Pinto Neto
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",

Re: Output from subprocess.Popen()

2006-10-16 Thread Fredrik Lundh
[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

Re: Output from subprocess.Popen()

2006-10-16 Thread [EMAIL PROTECTED]
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

Re: Output from subprocess.Popen()

2006-10-16 Thread Clodoaldo Pinto Neto
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

Re: Output from subprocess.Popen()

2006-10-16 Thread Sion Arrowsmith
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

Re: Output from subprocess.Popen()

2006-10-15 Thread Clodoaldo Pinto Neto
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

Re: Output from subprocess.Popen()

2006-10-15 Thread Fredrik Lundh
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 subprocess.Popen()

2006-10-15 Thread Clodoaldo Pinto Neto
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=&#x