En Wed, 21 Oct 2009 12:24:37 -0300, Tim Arnold <tim.arn...@sas.com> escribió:

Hi, I'm writing a script to capture a command on the commandline and run it
on a remote server.
I guess I don't understand subprocess because the code below exec's the
user's .cshrc file even though by default shell=False in the Popen call.

Do you mean it execs the .cshrc file in your *local* system or the *remote* one?
Popen controls what happens on the local system only.

        action.insert(0,'rsh my_remotehost')
        p = subprocess.Popen(shlex.split(' '.join(action)))
        p.wait()

Since the shell is executing in the child process anyway, is the only
difference when using shell=True is that environment variables can be
expanded in the command to be executed?

Note that in this case, "the child process" is rsh on the local system. Popen has no control over what happens once rsh starts.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to