[plug] send keystrokes to console program on execution line

byteme-its byteme-its at westnet.com.au
Tue Aug 2 09:27:16 WST 2011

Hi Shannon

----- Original Message -----
From: "Adrian Chadd" <adrian at creative.net.au>
Sent: Monday, 1 August, 2011 7:30:49 PM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi
Subject: Re: [plug] send keystrokes to console program on execution line

Google "expect" ?

On Mon, Aug 01, 2011, Shanon Loughton wrote:
> HI everyone
> Id like to run a simple terminal program and supply the keystrokes needed to
> kick it along, all in one line. Specifically its GLmark (
> http://sourceforge.net/projects/glmark/) (I know, out of date...)
> and it needs something like this wrt keystrokes after running from its
> directory:
> $ ./glmark [enter]
> 400 [enter]
> 300 [enter]
> 16 [enter]
> 1 [enter]

As Adrian said, look up expect. It should be in most repositories, debian: apt-get install expect

basically expect replaces the #!/bin/bash at the top of your "script" ie #!/bin/expect.

then you give it some commands: Start the program, expect this, send that... I use it for monitoring several programs, including a script I have written to shut down kids computers and downloading programs from the abc iview site... 


Adam Davin
Byteme IT Services. 

More information about the plug mailing list