From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115599 invoked by alias); 26 Feb 2016 13:04:28 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 115583 invoked by uid 89); 26 Feb 2016 13:04:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: Yes, score=5.8 required=5.0 tests=AWL,BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS,TBC autolearn=no version=3.3.2 spammy=txt, Enterprise, edition, H*r:7.5.7601.23008 X-HELO: DUB004-OMC1S1.hotmail.com Received: from dub004-omc1s1.hotmail.com (HELO DUB004-OMC1S1.hotmail.com) (157.55.0.200) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Fri, 26 Feb 2016 13:04:25 +0000 Received: from DUB115-W73 ([157.55.0.237]) by DUB004-OMC1S1.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Fri, 26 Feb 2016 05:04:22 -0800 X-TMN: [tdbd7ubHap53m+Qjgw4nP3vo1+5NqDpa] Message-ID: From: Matthijs Nescio To: "cygwin@cygwin.com" Subject: echo -n or sleep 0 needed to unblock Bourne shell script Date: Fri, 26 Feb 2016 13:04:00 -0000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2016-02/txt/msg00402.txt.bz2 Hi, I have the strangest problem. I am running some complicated advanced Bourne= shell scripting. These scripts work fine under Ubuntu 14.04 LTS. However, = in Cygwin I have to add some strange commands with no obvious effect; witho= ut these the scripts just hang. I can not disclose the scripts completely b= ecause they are company property. I realise that this does not comply to th= e rules of smart questions, but if anybody else has this problem the Cygwin= ners need to know about it. I do not exactly know when these problems start= ed. I reinstalled Cygwin twice, several weeks ago and yesterday evening. I have had this problem with several complicated, lengthy scripts. Debuggin= g using echo debug statements is hard because the echo makes the problem go= away. When I discovered similar problems in multiple scripts, I reinstalle= d Cygwin, but the problem persists. Also rebooting my Windows 7 Enterprise = edition machine does not solve the problem. I have had some experienced col= leagues to look at this and they were as flabbergasted as I was. Examples: =A0 TTP_FILE_DR_KML=3D`echo $TTP_FILE.dr.kml | sed -s 's#\.txt\.#\.#g'` =A0 #echo -n> /dev/null =A0 sleep 0 =A0 if [ "`convert_needed "$TTP_FILE_DR_KML"`" =3D "convert" ] =A0 then In the examples above and below, either the sleep or the echo has to be com= mented in, otherwise the script just hangs. In the example below the doit f= unction needs the echo or sleep, otherwise it does not return. doit() { =A0 # 8< code removed =A0 #echo -n =A0 sleep 0 } In order to investigate this problem the Cywinners will need more information= . Feel free to ask, but it may not be legal for me to share. Questions: * Was a similar issue ever reported? I have looked, but did not find anythi= ng. * Is there a solution? Thank you, kind regards, Matthijs. =20=09=09=20=09=20=20=20=09=09=20=20 -- 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