On 10/20/05, James Long <[EMAIL PROTECTED]> wrote: > Should these two commands produce identical output? > > $ bzegrep "38436|41640" /var/log/maillog.0.bz2 | wc -l > 0 > $ bzcat /var/log/maillog.0.bz2 | egrep "38436|41640" | wc -l > 121
Yep. Looks like a bug in the grep code. It looks at the name of the program to determine what to do. It first checks for 'z' and then 'b' at the first character, and then increments the pointer. With 'zgrep' and 'zegrep', that works fine, since it becomes 'grep' and 'egrep'. With 'bzegrep' it becomes 'zegrep', after it's already looked for 'z'. It doesn't know what to make of that so it just goes to the default 'grep'. You can use: egrep -J "38436|41640" /var/log/maillog.0.bz2 which will filter the file through bzip2. _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "[EMAIL PROTECTED]"