X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f Date: Sat, 01 Jan 2005 12:29:09 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp-workers AT delorie DOT com Message-ID: <01c4efec$Blat.v2.2.2$e02a37c0@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.2.2 In-reply-to: <1104530868.41d5cdb4750b2@webmail.wilkes.edu> (fdonahoe AT wilkes DOT edu) Subject: Re: Strange failure of egrep stub References: <1104530868 DOT 41d5cdb4750b2 AT webmail DOT wilkes DOT edu> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Fri, 31 Dec 2004 17:07:48 -0500 > From: fdonahoe AT wilkes DOT edu > > The failure came on the very first time egrep was invoked. > Rewritten as: > > egrep 'This is (ifnothtml|ifinfo|ifnottex) text' cond.out \ > >./cond-1 || exit 2 > > fails with 0 bytes in cond-1. My first guess would be that we have some snafu with redirection. Let's first find out whether the problem is at all with egrep. What version of Bash do you have installed, and does the behavior change if you use a different version of Bash? (I understand that the same command works if invoked from the cmd.exe prompt, right? That is, assuming that you replace single quotes with double quotes, to prevent the `|' characters from being interpreted by cmd.exe.) > grep is never given the chance to produce its output which > would be correct! If grep -E be substituted for egrep in > all four instances, cond-[1-4] are left with correct data > and the whole test is passed. What is egrep in your setup? Is it a Bash shell script that invokes "grep -E" or something else? > My conclusion is that egrep.exe invokes the djgpp2/coff grep > differently from the unsuopported coff grep, so that exit 2 happens > before grep produces its output. Sorry, I cannot understand this. What is djgpp2/coff and what is ``unsupported coff grep'', and how is their invocation relevant to this problem?