Re: nested escape chars in a shell command

2005-10-20 Thread Eli Criffield
I can't seem to get that to work either. child = pexpect.spawn('/bin/sh',args=['-c','/usr/bin/ssh','-t','-o','StrictHostKeyChecking no',host,command,'|','awk','{print %s:$0}'%host], timeout=30) Complains its getting the wrong arguments to ssh. Eli --

Re: nested escape chars in a shell command

2005-10-20 Thread jepler
I think you're mistaken about how 'sh -c' works. The next argument after -c is the script, and following arguments are the positional arguments. (what, you've never used -c in conjunction with positional arguments? me either!) Example:

Re: nested escape chars in a shell command

2005-10-19 Thread Juho Schultz
Eli Criffield wrote: I'm try run an ssh command in pexpect and I'm having trouble getting everything escaped to do what i want. Here's a striped down script showing what i want to do. -- #!/usr/bin/env python import pexpect import sys if len(sys.argv) 3: print ssh.py host

nested escape chars in a shell command

2005-10-18 Thread Eli Criffield
I'm try run an ssh command in pexpect and I'm having trouble getting everything escaped to do what i want. Here's a striped down script showing what i want to do. -- #!/usr/bin/env python import pexpect import sys if len(sys.argv) 3: print ssh.py host command sys.exit(1) host =