bug-grep
[Top][All Lists]
Advanced

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

[Fwd: Re: grep: -i option not working i cronjobs]


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

(Forwarding to the list.)

- Julian


-------- Original Message --------
Subject: Re: grep:  -i option not working i cronjobs
Date: Wed, 10 Nov 2004 15:06:27 +0100
From: J. W.Andersen, Falster System Teknik <address@hidden>
To: Julian Foad <address@hidden>
References: <address@hidden> <address@hidden> <address@hidden> <address@hidden>


Julian Foad wrote:

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


Hmmm - I don't think so. First, there is only one grep on the machine
(exept a link hereto in /usr/bin), and second,
you will notice, that I define the entire path to the grep program in
the script - the PATH variable should be of no
significance, as far as the grep executable is concerned. But as I said,
I cannot decide if there could be a missing¨
LIBPATH or something to some library file, I do not know about.

I have retrieved SuSE's source pack for the actual grep. As my C skille
are pretty rusty (have not used them much
for the past 10 years ), I am somewhat uncertain as to where to begin
and where to end. Could you maybe
give a hint as to which of the source modules are of primary interrest
for this issue ?

Again, thanks for your time - Joe.,





reply via email to

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