|go ahead... be a heretic|
Grep Issuesby jpk236 (Monk)
|on Dec 17, 2004 at 06:20 UTC||Need Help??|
jpk236 has asked for the
wisdom of the Perl Monks concerning the following question:
I have a script which parses large files -- 800+ lines full of content. Here is the line I use to grep the pattern out:
$output = `/usr/bin/grep -B NUM PATTERN FILE | /usr/bin/head -n 1`;
where NUM is an incrementing #, PATTERN is the matching string, and FILE is the file being read. This line is in a do..until.
For some reason, randomly, grep: write error: Broken pipe or grep: writing output: Broken pipe will output to the error log. The line is still parsed correctly -- but these error logs are annoying and I'd really like to know whats causing them. Thanks in advance!