maks attems
2004-May-17 08:39 UTC
[Logcheck-devel] Re: [Logcheck-commits] CVS logcheck/src
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