Re: sending to an xterm

2008-08-08 Thread Rich Healey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kent Tenney wrote: > Derek Martin pizzashack.org> writes: > >> On Fri, Aug 08, 2008 at 08:25:19PM +, Kent Tenney wrote: >>> Howdy, >>> >>> I want to open an xterm, send it a command and have it execute it. >> You can't do that. xterm doesn't exe

RE: sending to an xterm

2008-08-08 Thread Edwin . Madari
since I do not have access to xterm, here is the interactive session for spawning bash(another session if you will), sending ls command to it, and retrieving the results. things to note are: 1. after spawning expect for the prompt, timeout, and eof #which ever happens first 2. return value is th

Re: sending to an xterm

2008-08-08 Thread Kent Tenney
Derek Martin pizzashack.org> writes: > > On Fri, Aug 08, 2008 at 08:25:19PM +, Kent Tenney wrote: > > Howdy, > > > > I want to open an xterm, send it a command and have it execute it. > > You can't do that. xterm doesn't execute shell commands passed on > stdin... It can, however, execut

Re: sending to an xterm

2008-08-08 Thread Kent Tenney
Derek Martin pizzashack.org> writes: > > On Fri, Aug 08, 2008 at 08:25:19PM +, Kent Tenney wrote: > > Howdy, > > > > I want to open an xterm, send it a command and have it execute it. > > You can't do that. xterm doesn't execute shell commands passed on > stdin... It can, however, execut

Re: sending to an xterm

2008-08-08 Thread Derek Martin
On Fri, Aug 08, 2008 at 08:25:19PM +, Kent Tenney wrote: > Howdy, > > I want to open an xterm, send it a command and have it execute it. You can't do that. xterm doesn't execute shell commands passed on stdin... It can, however, execute one passed on the command line. Instead of just runni

Re: sending to an xterm

2008-08-08 Thread Emile van Sebille
Kent Tenney wrote: Howdy, I want to open an xterm, send it a command and have it execute it. I thought pexpect would do this, but I've been unsuccessful. term = pexpect.spawn('xterm') starts an xterm, but term.sendline('ls') doesn't seem to do anything. Suggestions? Thanks, Kent -- htt