piping input to executable reading from /dev/tty?

Eric Blake eblake@redhat.com
Wed Jun 20 16:41:00 GMT 2012


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



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20120620/9cf2117b/attachment.sig>


More information about the Cygwin mailing list