bug-grep
[Top][All Lists]
Advanced

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

Re: grep: -i option not working i cronjobs


From: Julian Foad
Subject: Re: grep: -i option not working i cronjobs
Date: Wed, 10 Nov 2004 12:42:19 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113

J. W.Andersen, Falster System Teknik wrote:
/bin/grep -o -i EXTRA.DAT /tmp/exdat > /tmp/exdatfn

Sadly, the combination of "-o" and "-i" is broken in grep 2.5.1 in this sort of way: whether it finds a match depends on the combination of cases used in the pattern and in the text being searched. Various Linux distributions provide patched versions of grep that may work better or differently, but basically that combination of modes is still broken.

This script works as charm when I run it from the console, but fails when 
started from cron.
Again, if I have an absolute match between the PATTERN in the commandline and 
tthe file
content, it works, but the case-independancy fails in the cronjob.

I don't have any explanation for why it works in the console but not in the cron job, unless the cron job is picking up a different "grep" program because its active PATH is different.

- Julian




reply via email to

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