I tried the following which doesn't work:
Code: Select all
type foo.log | findstr /r /c:"\<!-- foo:1 --\>" >nul
If %Errorlevel% Equ 0 (
Echo %Errorlevel%
) Else (
Echo %Errorlevel%
)
Instead of the Echo lines I'd like to have some kind of Set ReturnValue=%Errorlevel% instruction as soon as that part works.
If I manually execute the command
Code: Select all
type foo.log | findstr /r /c:"\<!-- foo:1 --\>" >nul
Code: Select all
type bar.log | findstr /r /c:"\<!-- foo:1 --\>" >nul
I wonder where the (logical?) error is...