public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: cygwin@cygwin.com
Subject: Re: piping input to executable reading from /dev/tty?
Date: Wed, 20 Jun 2012 16:41:00 -0000	[thread overview]
Message-ID: <4FE1FD33.3070009@redhat.com> (raw)
In-Reply-To: <4FE1FB4F.3020808@kempt.net>

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

On 06/20/2012 10:33 AM, Dan B. wrote:
> Is there any way to redirect /dev/tty similarly to how stdin can be
> redirected (e.g., like "echo ... | someexecutable")?

Yes; use 'expect'.

> Does Cygwin (or Unix/Linux, for that matter) have any equivalent way
> of redirecting /dev/tty?
> 
> Can /dev/tty be redirected at all?  (I would guess that something
> could be done with pseudoterminals, but I know very little about
> them.)

Yes, 'expect' is the command line tool that lets you script around
programs that expect to be run interactively, but where you want to
script the input that your program will see.

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

  reply	other threads:[~2012-06-20 16:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-20 16:34 Dan B.
2012-06-20 16:41 ` Eric Blake [this message]
2012-06-20 21:22   ` Dan B.
2012-06-20 21:26     ` Eric Blake
2012-06-21 11:35       ` Earnie Boyd

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=4FE1FD33.3070009@redhat.com \
    --to=eblake@redhat.com \
    --cc=cygwin@cygwin.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).