|
From: | Gary Turner |
Subject: | Re: How to fail on a find with grep using make? |
Date: | Tue, 24 Feb 2009 21:40:23 +1300 |
That worked perfectly. Thanks very much.----- Original Message ----- From: "Eli Zaretskii" <address@hidden>
To: "Gary Turner" <address@hidden> Cc: <address@hidden> Sent: Tuesday, February 24, 2009 8:52 AM Subject: Re: How to fail on a find with grep using make?
From: "Gary Turner" <address@hidden> Date: Mon, 23 Feb 2009 21:41:00 +1300I'm using grep to compile files created by a gui editor. Occasionally a 'badthing' gets into the files, and I'd like the compile to fail if that 'bad thing' is found in the file. By default grep 'fails' on not found, which would normally stop make. What I want is something like error if not grep 'bad thing' $< I'm using cmd.exe.Does the following work for you? It should work on W2K and later, AFAIK. foo: barcmd /c "grep BADTHING $< & if not ERRORLEVEL 1 exit 1"
[Prev in Thread] | Current Thread | [Next in Thread] |