X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:from:to:subject:date:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=f5a qBX0lBG3tbLPxnsYAvYqXgYpDcPnnriS4XXbza3ybmqYIQHHs5ifopYcjfFJBUaB QvpwwbqzDtSs6tlQNnwq15Hpf/ykDwd6AA9ah+CzyTuBbAkx2arWrEWGK7khqGsG Z3O0VXvh0+5pQjuYVxnwXzlhphKuSqsscwnv+NKo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:from:to:subject:date:content-type :content-transfer-encoding:mime-version; s=default; bh=3bmSq8rc0 mS0e+B2nntxLhHvLjs=; b=tUXvGhNRe4jbSxNhKD+ecOns4EZUTOfHF4XDQzzVG Seq6DE5pU0SroUf3zMOaX+Kkf/R/iWlBYamP932K6Wni1NHOBPe3XpaT+xSZQVWY kXuQtuGVqRYiYM/ummLZ9QBGmQnhvxIV6OKwyT4uTADizEHiwdXycWrtnBVmAwpu Q0= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 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 X-TMN: [tdbd7ubHap53m+Qjgw4nP3vo1+5NqDpa] Message-ID: From: Matthijs Nescio To: "cygwin AT cygwin DOT com" Subject: echo -n or sleep 0 needed to unblock Bourne shell script Date: Fri, 26 Feb 2016 14:04:22 +0100 Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u1QD4bLD010188 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; without these the scripts just hang. I can not disclose the scripts completely because they are company property. I realise that this does not comply to the rules of smart questions, but if anybody else has this problem the Cygwinners need to know about it. I do not exactly know when these problems started. I reinstalled Cygwin twice, several weeks ago and yesterday evening. I have had this problem with several complicated, lengthy scripts. Debugging using echo debug statements is hard because the echo makes the problem go away. When I discovered similar problems in multiple scripts, I reinstalled Cygwin, but the problem persists. Also rebooting my Windows 7 Enterprise edition machine does not solve the problem. I have had some experienced colleagues to look at this and they were as flabbergasted as I was. Examples:   TTP_FILE_DR_KML=`echo $TTP_FILE.dr.kml | sed -s 's#\.txt\.#\.#g'`   #echo -n> /dev/null   sleep 0   if [ "`convert_needed "$TTP_FILE_DR_KML"`" = "convert" ]   then In the examples above and below, either the sleep or the echo has to be commented in, otherwise the script just hangs. In the example below the doit function needs the echo or sleep, otherwise it does not return. doit() {   # 8< code removed   #echo -n   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 anything. * Is there a solution? Thank you, kind regards, Matthijs. -- 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