[Logcheck-devel] Re: [Logcheck-commits] CVS logcheck/src

maks attems debian at sternwelten.at
Mon May 17 08:39:00 UTC 2004


On Sat, 15 May 2004, CVS User ttroxell wrote:

> I'm still thinking about the best way to handle egrep and logtail ret vals.
 

for egrep we could check the existence of the file:
 egrep --text -v '^\s*$|^#' $dir/$rulefile >> $cleaned/$rulefile
 if [! -f $cleaned/$rulefile]; then
   error "Could not append to $cleaned/$rulefile.  Disk Full ?"
 elif [! -s $cleaned/$rulefile]; then
    if [ `egrep --text -v '^\s*$|^#' $dir/$rulefile|wc -l` > 0]; then
      error "Could not append to $cleaned/$rulefile.  Disk Full ?"
    fi
 fi

but the first check only works for the first egrep :(
well the second check came after same thoughts yesterday,
but this seems to introduce quite an overhead to grep 
every pattern twice, maybe this is an hint for someone else!?

a++ maks

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/logcheck-devel/attachments/20040517/fd3384fd/attachment.pgp 


More information about the Logcheck-devel mailing list