On Thu, Feb 26, 2009 at 2:41 AM, Visco Shaun wrote:
> hi all
>
> while getting used to with subprocess module i failed in executuing a)
> but succeeded in running b). Can anyone explain me why as i am providing
> absolute path? Is this has to do anything with shared library.. which
> must be acces
Visco Shaun schrieb:
> hi all
>
> while getting used to with subprocess module i failed in executuing a)
> but succeeded in running b). Can anyone explain me why as i am providing
> absolute path? Is this has to do anything with shared library.. which
> must be accessed based on system variables?
hi all
while getting used to with subprocess module i failed in executuing a)
but succeeded in running b). Can anyone explain me why as i am providing
absolute path? Is this has to do anything with shared library.. which
must be accessed based on system variables?
a) pipe = subprocess.Popen("/bi
George Sakkis <[EMAIL PROTECTED]> wrote:
> On May 15, 5:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
>> George Sakkis <[EMAIL PROTECTED]> wrote:
>>> I'm trying to figure out why Popen captures the stderr of a specific
>>> command when it runs through the shell but not without it. IOW:
>>>
On May 15, 5:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> George Sakkis <[EMAIL PROTECTED]> wrote:
> > I'm trying to figure out why Popen captures the stderr of a specific
> > command when it runs through the shell but not without it. IOW:
>
> > cmd = [my_exe, arg1, arg2, ..., argN]
> >
ython
from subprocess import Popen, PIPE
cmd = ["./zz.py"]
for i in range(2):
if i: # this captures both stdout and stderr as expected
print "With shell"
pipe = Popen(' '.join(cmd), shell=True, stderr=PIPE, stdout=PIPE)
else: # this captures on
I'm trying to figure out why Popen captures the stderr of a specific
command when it runs through the shell but not without it. IOW:
cmd = [my_exe, arg1, arg2, ..., argN]
if 1: # this captures both stdout and stderr as expected
pipe = Popen(' '.join(cmd), shell=True, stderr=PIPE, stdout=PIPE)
On Friday 10 June 2005 05:30 am, Tomasz Rola wrote:
> On Sun, 12 Jun 2005, km wrote:
>
> > hi all,
> >
> > can any linux command be invoked/ executed without using shell (bash) ?
> > what abt security concerns ?
>
> Ops, I missed the word "command" when reading your mail for the first
> time, an
Donn Cave wrote:
>> Not according the the docs:
>>
>> Also, for each of these variants, on Unix, cmd may be a
>> sequence, in which case arguments will be passed directly to
>> the program without shell intervention (as with os.spawnv()).
>> If cmd
On 2005-06-10, Donn Cave <[EMAIL PROTECTED]> wrote:
>> Also, for each of these variants, on Unix, cmd may be a
>> sequence, in which case arguments will be passed directly to
>> the program without shell intervention (as with os.spawnv()).
>> If cmd is a s
, os.popen is posix.popen, is a simple wrapper around
> > the C library popen. It always invokes the shell.
>
> Not according the the docs:
>
> Also, for each of these variants, on Unix, cmd may be a
> sequence, in which case arguments will be passed directly to
> the pr
Donn Cave <[EMAIL PROTECTED]> writes:
> In article <[EMAIL PROTECTED]>,
> Grant Edwards <[EMAIL PROTECTED]> wrote:
>
>> On 2005-06-10, Mage <[EMAIL PROTECTED]> wrote:
>>
>> >>py> file_list = os.popen("ls").read()
>> >>
>> >>Stores the output of ls into file_list.
>> >>
>> > These commands invoke
It always invokes the shell.
Not according the the docs:
Also, for each of these variants, on Unix, cmd may be a
sequence, in which case arguments will be passed directly to
the program without shell intervention (as with os.spawnv()).
If cmd is a string it will be passed to the shell (as with
KM writes:
> can any linux command be invoked/ executed without using shell (bash) ?
> what abt security concerns ?
Yes.
See: http://docs.python.org/lib/module-subprocess.html
An exerpt:
> On Unix, with shell=False (default): In this case, the Popen class uses
> os.execvp() to execute the child
In article <[EMAIL PROTECTED]>,
Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2005-06-10, Mage <[EMAIL PROTECTED]> 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 invo
On Fri, 10 Jun 2005 14:13:05 +, Grant Edwards wrote:
> On 2005-06-10, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>> On Sun, 12 Jun 2005 23:16:35 +0530, km wrote:
>>
>>> hi all,
>>>
>>> can any linux command be invoked/ executed without using shell (bash) ?
>>
>> py> import os
>> py> status =
On 2005-06-10, Mage <[EMAIL PROTECTED]> 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.
--
Grant Edwards
Steven D'Aprano wrote:
>On Sun, 12 Jun 2005 23:16:35 +0530, km wrote:
>
>
>
>>hi all,
>>
>>can any linux command be invoked/ executed without using shell (bash) ?
>>
>>
>
>py> import os
>py> status = os.system("ls")
>
>Prints the output of ls and stores the exit code into status.
>
>py> fil
On 2005-06-10, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Sun, 12 Jun 2005 23:16:35 +0530, km wrote:
>
>> hi all,
>>
>> can any linux command be invoked/ executed without using shell (bash) ?
>
> py> import os
> py> status = os.system("ls")
>
> Prints the output of ls and stores the exit cod
On 2005-06-12, km <[EMAIL PROTECTED]> wrote:
> can any linux command be invoked/executed without using shell (bash)?
Yes -- for some values of "linux command". You can execute
anything that's not a bash internal or a bash script without
using bash.
> what abt security concerns?
What about them
On Sun, 12 Jun 2005 23:16:35 +0530, km wrote:
> hi all,
>
> can any linux command be invoked/ executed without using shell (bash) ?
py> import os
py> status = os.system("ls")
Prints the output of ls and stores the exit code into status.
py> file_list = os.popen("ls").read()
Stores the output
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Sun, 12 Jun 2005, km wrote:
> hi all,
>
> can any linux command be invoked/ executed without using shell (bash) ?
> what abt security concerns ?
Ops, I missed the word "command" when reading your mail for the first
time, and this changes some p
k from the OS, and put inside some replacement of your own.
But it all depends on what exactly you are going to achieve...
1. Disabling rootkits/shellcodes.
Without shell (i.e. bash/sh), you loose lots of functionality and you
don't get as much in exchange. If what you want really is to di
hi all,
can any linux command be invoked/ executed without using shell (bash) ?
what abt security concerns ?
regards,
KM
--
http://mail.python.org/mailman/listinfo/python-list
24 matches
Mail list logo