Formail: what is the +skip option for and why?

David W. Tamkin dattier at
Sat Sep 30 06:39:58 CEST 2006


> I an redoing some older scripts, and I don't understand why I have a +1
> in the formail statement.  With or without, the answer is the same - so
> what is it used for?
> [sda at beaujolais ~]$ formail -X'From ' -cs < $HOME/mail/junk | wc -l
>       126
> [sda at beaujolais ~]$ formail +1 -X'From ' -cs < $HOME/mail/junk | wc -l
>       126

Seee the formail(1) man page.  With -s, +# means to skip the first # 
split-out messages and omit them from the output.

Since both results were 126, I see two possibilities:

1. What formail sees as the first split-out message in the file is 
something that doesn't have a From_ postmark (though wouldn't the 
absence of -f add one?), or
2. a 127th message was added to the file between the two attempts.

Try this:

  formail -1s < $HOME/mail/junk

and see what comes out.

More information about the procmail mailing list