public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
* writing a script to simulate keyboard input
@ 2007-07-19 15:48 Karthik Vishwanath
  2007-07-19 22:39 ` Eric Bambach
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Karthik Vishwanath @ 2007-07-19 15:48 UTC (permalink / raw)
  To: Newbie List

Hello,

I have to use an archaic, menu-driven C program that requires keyboard 
input to process commands (all of these commands are terminated by a 
newline)

I was wondering if there was any way I could use the program within a 
script so that I could have the script "feed" in the sequence of 
keystrokes/string-inputs that I must otherwise type in manually?

As ever, all help/advice is appreciated.


Thanks,

-K

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: writing a script to simulate keyboard input
  2007-07-19 15:48 writing a script to simulate keyboard input Karthik Vishwanath
@ 2007-07-19 22:39 ` Eric Bambach
  2007-07-19 23:56 ` Mateus Interciso
  2007-07-20 23:35 ` Benway
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Bambach @ 2007-07-19 22:39 UTC (permalink / raw)
  To: karthikv; +Cc: Newbie List

On Thursday 19 July 2007 10:48, Karthik Vishwanath wrote:
> Hello,
>
> I have to use an archaic, menu-driven C program that requires keyboard
> input to process commands (all of these commands are terminated by a
> newline)
>
> I was wondering if there was any way I could use the program within a
> script so that I could have the script "feed" in the sequence of
> keystrokes/string-inputs that I must otherwise type in manually?
>
> As ever, all help/advice is appreciated.

Have you seen Perl's expect module?

>
> Thanks,
>
> -K
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs

-- 
Thanks,

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: writing a script to simulate keyboard input
  2007-07-19 15:48 writing a script to simulate keyboard input Karthik Vishwanath
  2007-07-19 22:39 ` Eric Bambach
@ 2007-07-19 23:56 ` Mateus Interciso
  2007-07-20 23:35 ` Benway
  2 siblings, 0 replies; 4+ messages in thread
From: Mateus Interciso @ 2007-07-19 23:56 UTC (permalink / raw)
  To: linux-newbie

On Thu, 19 Jul 2007 11:48:58 -0400, Karthik Vishwanath wrote:

> Hello,
> 
> I have to use an archaic, menu-driven C program that requires keyboard
> input to process commands (all of these commands are terminated by a
> newline)
> 
> I was wondering if there was any way I could use the program within a
> script so that I could have the script "feed" in the sequence of
> keystrokes/string-inputs that I must otherwise type in manually?
> 
> As ever, all help/advice is appreciated.
> 
> 
> Thanks,
> 
> -K
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie"
> in the body of a message to majordomo@vger.kernel.org More majordomo
> info at  http://vger.kernel.org/majordomo-info.html Please read the FAQ
> at http://www.linux-learn.org/faqs

As far as I know, this greatly depends on the C program you are trying to 
use.
But one thing that doesn't hurt trying, is to pipe it with an echo 
command, for instance
echo "command string" | ./program
A pratical example would be to actually count how many leters you have in 
abcdef, for this, execute this
echo "abcdef" | wc -c
The | will execute the command that's after the | with the output (I 
think) of what's on the left of the |

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: writing a script to simulate keyboard input
  2007-07-19 15:48 writing a script to simulate keyboard input Karthik Vishwanath
  2007-07-19 22:39 ` Eric Bambach
  2007-07-19 23:56 ` Mateus Interciso
@ 2007-07-20 23:35 ` Benway
  2 siblings, 0 replies; 4+ messages in thread
From: Benway @ 2007-07-20 23:35 UTC (permalink / raw)
  To: karthikv, Newbie List

Karthik Vishwanath wrote:
> Hello,
>
> I have to use an archaic, menu-driven C program that requires keyboard 
> input to process commands (all of these commands are terminated by a 
> newline)
>
> I was wondering if there was any way I could use the program within a 
> script so that I could have the script "feed" in the sequence of 
> keystrokes/string-inputs that I must otherwise type in manually?
>
> As ever, all help/advice is appreciated.
>
>
> Thanks,
>
> -K
>
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
>
> -- 
> This email has been verified as Virus free
> Virus Protection and more available at http://www.plus.net
Expect - http://expect.nist.gov/
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-20 23:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-19 15:48 writing a script to simulate keyboard input Karthik Vishwanath
2007-07-19 22:39 ` Eric Bambach
2007-07-19 23:56 ` Mateus Interciso
2007-07-20 23:35 ` Benway

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox