maks attems
2004-May-17 16:52 UTC
[Logcheck-devel] Re: [Logcheck-commits] CVS logcheck/src
hey todd, I think you were right, that we need to check _all_ return values. sorry about my previous noise. we can therefor reduce the probability of a failing grep and the disc may already be very full if cat header fails. oooh i found i nice pointer at the manpage of grep(1): DIAGNOSTICS Normally, exit status is 0 if selected lines are found and 1 otherwise. But the exit status is 2 if an error occurred, unless the -q or --quiet or --silent option is used and a selected line is found. so todd please reanable your check for footer, and add a check for egreps of exit status 2! yuppiieee 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/9f927716/attachment.pgp
Todd Troxell
2004-May-19 08:15 UTC
[Logcheck-devel] Re: [Logcheck-commits] CVS logcheck/src
On Mon, May 17, 2004 at 06:52:51PM +0200, maks attems wrote:> I think you were right, that we need to check _all_ > return values. > > we can therefor reduce the probability of a failing grep > and the disc may already be very full if cat header fails.enabled!> oooh i found i nice pointer at the manpage of grep(1): > DIAGNOSTICS > Normally, exit status is 0 if selected lines are found and 1 otherwise. > But the exit status is 2 if an error occurred, unless the -q or --quiet > or --silent option is used and a selected line is found. > > so todd please reanable your check for footer, > and add a check for egreps of exit status 2!The problem is, we get the same exit status when grep either: -cannot append to the file -does not find any matches (It's 1 both times) The problem is that the error is not a grep error and comes from the shell (>>), so grep doesn't know. ...or did I misunderstand? I know of ways to do this, but they are not pretty :\ -- [ Todd J. Troxell ,''`. Student, Debian GNU/Linux Developer, SysAdmin, Geek : :' : http://debian.org || http://rapidpacket.com/~xtat `. `' `- ] -------------- 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/20040519/a9298185/attachment.pgp