X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-6.9 required=5.0	tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4BF6ABC3.1070304@redhat.com>
Date: Fri, 21 May 2010 09:50:27 -0600
From: Eric Blake <eblake@redhat.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b1 Mnenhy/0.8.2 Thunderbird/3.0.4
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: 1.7.5: Bug with bash read in /etc/profile.d invocation
References: <A4AC3816FD34354F878DD1F440F3ABCE02284615@CINMLVEM24.e2k.ad.ge.com> <AANLkTinZUAtd_g3XeSDQdPQJbqL64Cg3RsKXVtNvLH8y@mail.gmail.com> <A4AC3816FD34354F878DD1F440F3ABCE02398679@CINMLVEM24.e2k.ad.ge.com> <A4AC3816FD34354F878DD1F440F3ABCE02398DBD@CINMLVEM24.e2k.ad.ge.com> <A4AC3816FD34354F878DD1F440F3ABCE02418585@CINMLVEM24.e2k.ad.ge.com>
In-Reply-To: <A4AC3816FD34354F878DD1F440F3ABCE02418585@CINMLVEM24.e2k.ad.ge.com>
Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigD5D8C9F73C001534B9E4E5DC"
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

--------------enigD5D8C9F73C001534B9E4E5DC
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 05/21/2010 09:20 AM, Garber, Dave (GE Infra, Energy, Non-GE) wrote:
> Anyone have an ideas?  I'm stumped.

Please don't top-post.  http://cygwin.com/acronyms/#TOFU

> OK, I changed my script to have:
> 	read -p "How are you today? " Ans </dev/stdin But I now get "bash: /dev/=
stdin: No such file or directory"
>=20
> Since profile is redirecting stdin & stdout, wouldn't it make more sense =
for profile to redirect stdin and stdout back to normal when sourcing the p=
rofile.d scripts?

If stdin is redirected, then /dev/stdin points to that redirected
location.  Don't you instead want to read from the controlling terminal,
/dev/tty?

But seriously, trying to do _anything_ interactive in your startup
scripts is a recipe for disaster.  You are very likely to cause yourself
an inability to ssh in to your machine, when the login script outputs
data or blocks waiting for input.  Startup scripts are supposed to be
silent, neither producing nor consuming data, in a typical setup.

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enigD5D8C9F73C001534B9E4E5DC
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJL9qvDAAoJEKeha0olJ0NqROkH/1XtmHG1roP65QcmvIIZEXzs
rzRzfpkUGKYcOsGTIH16TIOvutvhKxCnK1N3Cs2BFrqp6yzYyjWbtGhIDdw/vlpT
O/5bnwgCid64alt9P5Bu8K0zzDC0Nz1588FOiIdfuGlBVlHkF6tBZbPF2yYC/Ye8
mIX7gq/9gBQvURwxcOvueUExpe8tk9PNy863KhlYusvv41pb8CxJxrzkew66EkpT
6UjAmHCCQZnMAVfLjebSkcakfLS+c/Fx9PrNrCPaWdSX/DUCm+ZHzgwVSmhiNTDg
iceV7UnrxeQFqEB7joRUHSyzqKn+3HAPOfYNe+1b8KVqWZQfLZtXeq8B/5S8B4Q=
=FBWi
-----END PGP SIGNATURE-----

--------------enigD5D8C9F73C001534B9E4E5DC--
