delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/24/09:51:35

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Thu, 24 Apr 2003 08:51:23 -0500
From: tmpaddr31 AT trodman DOT com
Message-Id: <200304241351.h3ODpN6h014738@tigris.pounder.sol.net>
X-Authentication-Warning: tigris.pounder.sol.net: rodmant set sender to tmpaddr31 AT trodman DOT com (Tom Rodman) using -f
To: cygwin AT cygwin DOT com
X-note: 1G0!G/usr/sbin/sendmail -v -t -f"tmpaddr31 AT trodman DOT com (Tom Rodman)" # less traceable, bypasses MUA
X-note: -t => determine receipients from STDIN/headers
Reply-to: tmpaddr31 AT trodman DOT com
Subject: bash: "read -p MY_PROMPT ANS" not always flushing MY_PROMPT text to STDOUT
Mime-Version: 1.0

bash script snippet (1.3.20; CYGWIN set to "binmode tty ntsec" ):

   #prompt text in some cases does not show up:
   read -p "pls enter your answer here > " ANSWER

   #this workaround has never failed:
   echo -n "pls enter your answer here > "
   read ANSWER

We're upgrading from a very old version of cygwin and are finding
we have to adjust perl and bash scripts with workarounds
; in general the scripts are supposed to be sending
text to STDOUT just prior to prompting for user input- this 
prompt text is not always showing up.  

I searched the mailing list for similiar issues and came up with
several near matches, but not specifically with bash.  Like another
poster I had to adjust a perl script to force it to flush a 
print to STDOUT ("tell STDOUT ;" seemed to fix it).  

The bash problem is buried in a fairly involved set of scripts, and
I have not been able to come up with a simplied case that
exhibits the bug- don't have the time now.  When time permits
I will send a test case.

Thanks as always for cygwin!

--
regards,
Tom Rodman
perl -e 'print unpack("u", "\.\=\$\!T\<F\]D\;6\%N\+F\-O\;0H\`");'

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

- Raw text -


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