X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-10.2 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <4FE1FD33.3070009@redhat.com> Date: Wed, 20 Jun 2012 10:41:23 -0600 From: Eric Blake User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: piping input to executable reading from /dev/tty? References: <4FE1FB4F DOT 3020808 AT kempt DOT net> In-Reply-To: <4FE1FB4F.3020808@kempt.net> OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig5517D9922634C5E5E1654D0D" X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --------------enig5517D9922634C5E5E1654D0D Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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? >=20 > 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. --=20 Eric Blake eblake AT redhat DOT com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig5517D9922634C5E5E1654D0D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJP4f01AAoJEKeha0olJ0NqDoIIAIdR0FHpygzrpJYvPqq+UQ53 C5BBIHeEs/UaKrNayNEFer3SVzBKCcUECovFUv8LMtUZlStq1LaiZRxpBUbl2qro Pdz7ry6/AwB5IN4b938lvLZNctgM17O7lyjhy1dB4nR/GkSG3cnYi+OLrGQ/oEHk M64W2VQwPKYNB/hf6wL/ofSM+Vv1ZlwtXJP9r7ViJN8kdaFAuILl2unLXJCnPyB1 dJKxda7M2bOP/+bNZbCtuCqtAzPwsAPqf3gFQ9tlcoEKSG6UoH5I5ETjbPoeYA0J OgIEi92iGY380pxq0lK3YVLKLS/3aaGPKU4zB9undiwVfiXD1XaeweiwfTrP8LQ= =qkmZ -----END PGP SIGNATURE----- --------------enig5517D9922634C5E5E1654D0D--