On Tue, 7 Jun 2005, Bob McClure Jr wrote:

> On Tue, Jun 07, 2005 at 10:42:07AM -0400, Mike Schrauder wrote:
> > pardon my complete unix ignorance, I have been trying to figure
> > out how to get debug output to a file so I can go back and look
[snip..]
> > i've also tried  spamassassin -D -t < test2.txt > test2.out | more
> > just so I could look, but that doesn't work.  Can you give a
> > windows user a clue?  TIA
>
>   spamassassin -D -t < test2.txt > test2.out 2> dbug.out
>
> 2 is the file handle for stderr.

Other trick, if you want stdout & stderr to go into the same file
use:
    spamassassin -D -t < test2.txt > test2.out 2>&1

The syntax '2>' says work on file handle #2, the '>&1' says
make it go to the same place that file handle #1 (usually stdout)
has been routed to.

So if you wanted it all to go into a pipe (so that you can feed it
to 'grep', 'more' or some other utility) use:

  spamassassin -D -t < test2.txt 2>&1 | more

While we're at tricks, if you want to test a particular rule, try:

  spamassassin -t -D rulesrun=255 < test2.txt test2.out 2>&1

The '-D rulesrun=255' option says show the processing of all rules
as they hit if they have a non-zero score. Only issue with this is
that the '__RULE' syntax (for creating meta-rules) have no score and
so don't show. If debugging such critters, change them to '_T_RULE'
names, those have a small but non-zero score and thus show.

-- 
Dave Funk                                  University of Iowa
<dbfunk (at) engineering.uiowa.edu>        College of Engineering
319/335-5751   FAX: 319/384-0549           1256 Seamans Center
Sys_admin/Postmaster/cell_admin            Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{

Reply via email to