bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with egrep.exe


From: Eli Zaretskii
Subject: Re: Problem with egrep.exe
Date: Sun, 04 Nov 2001 20:20:17 +0200

> From: "Dessel, Jason" <address@hidden>
> Date: Sun, 4 Nov 2001 09:46:38 -0800
> 
> It doesn't seem to return the proper errorlevels when the program exits...
> 
> c:\ntsched\egrep -i "03" findusr2.tmp 
> if errorlevel==0 echo FOUND
> 
> Or
> 
> c:\ntsched\egrep -i "03" findusr2.tmp 
> if errorlevel==1 echo FOUND
> 
> Always echo "FOUND" regardless of whether the 03 was found in the file.

Are you aware that errorlevel==1 tests whether the exit status is 1
_or_more_?  Similarly, errorlevel==0 will echo FOUND if the exit
status is 0 or greater.  If you want to test for zero alone, use this:

  if not errorlevel==1 echo FOUND

I just tested this, and it works for me.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]