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


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

Attachment: signature.asc
Description: OpenPGP digital signature


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