www.delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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 |
To: | cygwin AT cygwin DOT com |
From: | Pekka Niiranen <pekka DOT niiranen AT wlanmail DOT com> |
Subject: | Re: SOLUTION: Strange behaviour with output redirection (MORE information, Bug in awk.exe?) |
Date: | Thu, 12 May 2005 18:42:09 +0300 |
Lines: | 71 |
Message-ID: | <d5vt1u$9he$1@sea.gmane.org> |
References: | <d5flgq$rk8$2 AT sea DOT gmane DOT org> <d5ktvq$194$1 AT sea DOT gmane DOT org> |
Mime-Version: | 1.0 |
User-Agent: | Mozilla Thunderbird 1.0.2 (Windows/20050317) |
In-Reply-To: | <d5ktvq$194$1@sea.gmane.org> |
X-IsSubscribed: | yes |
Pekka Niiranen wrote: Got it! I had 7 following lines ord1=`expr 300` echo "Base ordinal is ${ord1}" ord=`expr ${ord1} + 5` #subsequent module interval counter prev=`expr 0` ctr=`expr 1` count=`expr 0` disp_nb=`expr 264` BEFORE the awk call ${FAWK}/"Number_of_Loops/{print \$3}" subst$1 >${TMPDIR}/$$ [ -s ${TMPDIR}/$$ ] && < ${TMPDIR}/$$ read count Commenting out ANY one of those 7 lines fixed the problem. It seems I was running out of some resources but cannot explain what is it. Is "$(( ))" for arithmetic safer? Anyone? -pekka- > Hi again, > > I managed to isolate the problem to the awk.exe. > Calling like this: > > export FAWK; FAWK="awk -F^ --compat --source=" > ${FAWK}/"SIMU_included/{print \$3}" subst$1 >${TMPDIR}/$$ > [ -s ${TMPDIR}/$$ ] && < ${TMPDIR}/$$ read SIMU > > works only occassionally. But calling awk without redirection > first works 100% of the time. > > export FAWK; FAWK="awk -F^ --compat --source=" > ${FAWK}/"SIMU_included/{print \$3}" subst$1 > ${FAWK}/"SIMU_included/{print \$3}" subst$1 >${TMPDIR}/$$ > [ -s ${TMPDIR}/$$ ] && < ${TMPDIR}/$$ read SIMU > > What is happening here? I am using the 1.5.16-1 version of Cygwin. > > -pekka- > > Pekka Niiranen wrote: > >> Hi there, >> >> I am using the following convention to set variables in Bash: >> >> awk -f /"SIMU_included/{print \$3}" subst$1 >${TMPDIR}/$$ >> [ -s ${TMPDIR}/$$ ] && < ${TMPDIR}/$$ read SIMU >> >> For some reason parameter "SIMU" gets set randomly. >> Could this be due W2K's buffering in creation of >> temporary file ${TMPDIR}/$$? i.e read happens before file >> is written on disk? >> >> For some reason setting "ntsec" seems to help but this does not >> explain the random success of file reading. >> >> -pekka- >> >> > > -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |