From: Mateus Interciso <p.zarnick@gmail.com>
To: linux-newbie@vger.kernel.org
Subject: Re: writing a script to simulate keyboard input
Date: Thu, 19 Jul 2007 23:56:00 +0000 (UTC) [thread overview]
Message-ID: <f7otmf$r55$1@sea.gmane.org> (raw)
In-Reply-To: Pine.LNX.4.64.0707191142490.11409@localhost
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
next prev parent reply other threads:[~2007-07-19 23:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2007-07-20 23:35 ` Benway
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='f7otmf$r55$1@sea.gmane.org' \
--to=p.zarnick@gmail.com \
--cc=linux-newbie@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.