Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 To: cygwin AT cygwin DOT com From: Pekka Niiranen Subject: Re: Strange behaviour with output redirection (MORE information, Bug in awk.exe?) Date: Sun, 08 May 2005 14:49:58 +0300 Lines: 40 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) In-Reply-To: X-IsSubscribed: yes 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/