[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep: -i option not working i cronjobs
From: |
J. W.Andersen, Falster System Teknik |
Subject: |
Re: grep: -i option not working i cronjobs |
Date: |
Wed, 10 Nov 2004 11:50:18 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040910 |
Julian Foad wrote:
J. W.Andersen, Falster System Teknik wrote:
Scenario: grep 2.51, distro: SuSE 9.1
When grep is running in a cron job, the "-i" option does not work.
I get matches reported only when PATTERN and file content is
exaclty identical. When run from console, everything works fine.
Same result under different shells - sh, bash and csh have been tested.
Please send Grep bug reports to <address@hidden>. Presently that is
an alias for <address@hidden> but soon it is likely to be a
separate list.
Please give enough details so that we can reproduce the problem. Give
the exact grep command being executed, and an example of the contents
of a file to be searched, in which grep fails to find the correct
matches.
- Julian
Sure - and thanks for coming back to me BTW.
What am I trying to do ?
On the Linux server, I have a repository for McAfee's antivirus system
for some Windows clients.
Untill now, the daily/hourly update of this repository had to be done on
a special Windows machine,
and I am converting this update procedure to run as a cronjob on the
Linux server.
McAfee - or at least their local subsidiary - frequently offers
intermediate updates between the
regular weekly updates to cover some recent virus treats, these
intermediate updates are
shipped as a file named extra.dat. Alas, as the repository is meant for
Windows systems, that
don't care about the use of upper/lowercase in filenames, McAfee is
rather inconsequent in
their filenaming - this week the file is named extra.dat, the week
before as EXTRA.DAT,
and maybe they name it Extra.Dat - or heaven knows what - next week.
With LFTP I retrieve a directory listing from the McAfee server, this is
the file exdat (attached).
You will see the filename, I am looking for, extra.dat, at the end of
that file.
In the following script, I attempt to find, if case-independent string
extra.dat occurs in the file
#! /bin/bash
#
/bin/grep -o -i EXTRA.DAT /tmp/exdat > /tmp/exdatfn # Locate
extra.dat in dir-list
#
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 wondered if maybe access to some library is missing when running under
cron ? BTW, the
file to be processed *IS* of course globally readable. As earlier
mentioned, I have tried
different shells - bash, sh, csh - all with the same result.
Thanks, Joe.
-rw-r--r-- 1 0 100 1149 Nov 05 15:49 extra-x4404a.zip
-rw-r--r-- 1 0 100 2347 Nov 05 15:49 extra.dat
- Re: grep: -i option not working i cronjobs,
J. W.Andersen, Falster System Teknik <=
- Re: grep: -i option not working i cronjobs, Julian Foad, 2004/11/10
- Message not available
- Re: grep: -i option not working i cronjobs, Julian Foad, 2004/11/10
- Re: grep: -i option not working i cronjobs, J. W.Andersen, Falster System Teknik, 2004/11/10
- Re: grep: -i option not working i cronjobs, J. W.Andersen, Falster System Teknik, 2004/11/11
- Re: grep: -i option not working i cronjobs, Tony Abou-Assaleh, 2004/11/11
- Re: grep: -i option not working i cronjobs, Tim Waugh, 2004/11/12
- Re: grep: -i option not working i cronjobs, Stepan Kasal, 2004/11/12
- [bug-grep] Re: grep: -i option not working i cronjobs, Julian Foad, 2004/11/12