delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/21/16:21:53

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: RE: 1.7.5: Bug with bash read in /etc/profile.d invocation
Date: Fri, 21 May 2010 16:21:35 -0400
Message-ID: <A4AC3816FD34354F878DD1F440F3ABCE02418AEE@CINMLVEM24.e2k.ad.ge.com>
In-Reply-To: <4BF6ABC3.1070304@redhat.com>
References: <A4AC3816FD34354F878DD1F440F3ABCE02284615 AT CINMLVEM24 DOT e2k DOT ad DOT ge DOT com> <AANLkTinZUAtd_g3XeSDQdPQJbqL64Cg3RsKXVtNvLH8y AT mail DOT gmail DOT com> <A4AC3816FD34354F878DD1F440F3ABCE02398679 AT CINMLVEM24 DOT e2k DOT ad DOT ge DOT com> <A4AC3816FD34354F878DD1F440F3ABCE02398DBD AT CINMLVEM24 DOT e2k DOT ad DOT ge DOT com> <A4AC3816FD34354F878DD1F440F3ABCE02418585 AT CINMLVEM24 DOT e2k DOT ad DOT ge DOT com> <4BF6ABC3 DOT 1070304 AT redhat DOT com>
From: "Garber, Dave (GE Infra, Energy, Non-GE)" <dave DOT garber AT ge DOT com>
To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Thanks.  /dev/tty works.  It's a script that I inherited.  Just trying
to keep it working until we can eliminate it.


Dave=20


-----Original Message-----
From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf
Of Eric Blake
Sent: Friday, May 21, 2010 11:50 AM
To: cygwin AT cygwin DOT com
Subject: Re: 1.7.5: Bug with bash read in /etc/profile.d invocation

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 profile.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 AT redhat DOT com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019