in reply to Re^2: Write a file if grep finds a pattern?
in thread Write a file if grep finds a pattern?

Let's say, you're asking the shell to run grep and discard the output, then collect the output, and if you say anything, you ask the shell to put something in a file, all to show your "Perl" program is as long as a shell one?

It doesn't even work this way.

But if you want to golf (if you have 'ack', shave off one character):

grep error c:/temp/logbook.log&&echo 'ok!'>/temp/ok.txt
Slapping backquotes on it to make it "Perl", still is two characters more.