procmail
[Top] [All Lists]

Re: formail and multiple tasks

1995-10-12 14:36:05
Sean Straw wrote,

(Stephen van den Berg had suggested:)

| >Try this instead:
| >
| >:0 hf
| >* whatever
| >| $FORMAIL -rt -X "" ; cat $HOME/newHeaders

| Okay, but in short, the following isn't unkosher, it just doesn't rely on 
| age-old UNIX commands (like sed in a previous post):

My use of sed was an attempt to avoid forking a shell; it's a side issue.
[I'm stuck for solving it, too, since the sed on this site has a broken P
command.]

|  | ( $FORMAIL -rt -I "Subject: Some new subject" | unblank ;\
|      mimecode $HOME/ftp/somefile /body:$HOME/ftp/somefile.inf ) ;\
|      | $SENDMAIL -t

It is far more efficient, if possible, to use one program than two with a
pipe; if formail can do the job alone with -X "", that's better than piping
formail to unblank.

| unblank is a small program I plinked out to get a line from stdin and send it 
| to stdout as long as it wasn't blank.

You mean it's equivalent to

     grep .

(note the period)?

<Prev in Thread] Current Thread [Next in Thread>