This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: 1.7.5: Bug with bash read in /etc/profile.d invocation


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


Dave 


-----Original Message-----
From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] On Behalf
Of Eric Blake
Sent: Friday, May 21, 2010 11:50 AM
To: cygwin@cygwin.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"
> 
> 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.

-- 
Eric Blake   eblake@redhat.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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]