[Logcheck-devel] Re: [Logcheck-commits] CVS logcheck/src
Todd Troxell
ttroxell at debian.org
Wed May 19 09:52:16 UTC 2004
On Wed, May 19, 2004 at 10:45:18AM +0200, maks attems wrote:
> On Wed, 19 May 2004, Todd Troxell wrote:
> > 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.
>
> you are right, just tested:
> baikonur:~ egrep TODO secret/whativedone >> /tmp/blaa
> grep: write error: No space left on device
> baikonur:~ echo $?
> 1
>
>
> > I know of ways to do this, but they are not pretty :\
>
> seems so :(
aha!
xtat at port:~$ egrep Outgrafbe mimsy.txt|cat >> /dev/null; echo $?
with pipe to cat == return 0, matches or not
return 1 on unable to output
--
[ 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/88e716db/attachment.pgp
More information about the Logcheck-devel
mailing list