Just use grep -E here (fgrep -E seems to have stopped working at some
point anyway).
#!/bin/sh
#
# $FreeBSD: src/etc/periodic/daily/470.status-named,v 1.8 2006/06/11 20:39:12 maxim Exp $
-# $DragonFly: src/etc/periodic/daily/470.status-named,v 1.4 2007/12/29 21:44:44 matthias Exp $
#
# If there is a global system configuration file, suck it in.
start=`date -v-1d '+%b %e'`
rc=$(catmsgs |
- fgrep -E "^$start.*named\[[[:digit:]]+\]: transfer of .*failed .*: REFUSED" |
+ grep -E "^$start.*named\[[[:digit:]]+\]: transfer of .*failed .*: REFUSED" |
sed -e "s/.*transfer of \'\(.*\)\/IN\' from \(.*\)#[0-9]*: .*/\1 from \2/" |
sort -f | uniq -ic | (
usedns=0