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 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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: In-Reply-To: <4BF6ABC3.1070304@redhat.com> References: <4BF6ABC3 DOT 1070304 AT redhat DOT com> From: "Garber, Dave (GE Infra, Energy, Non-GE)" To: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 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 =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