procmail
[Top] [All Lists]

Re: delete folder before writing to it

2012-11-09 09:54:28

Date: Fri, 09 Nov 2012 16:09:28 +0100
From: Eric Smith <es(_at_)fruitcom(_dot_)com>
Subject: Re: delete folder before writing to it

Robert Bonomi wrote on Fri-09-Nov 12  9:32AM
:0c:
{
:0c:
backup
:0f
| rm $MAILDIR/last
:0:
last
}


try ':0fw' instead of ':0f'.  Must 'wait' for the pipe to complete, before
starting the next recipe.

Thanks Robert, alas, it is still not playing nice. Nothing I 
try leaves any (non-white) data in the folder last.

Any ideas how to have the last and only the last email 
always living in that folder.

Eric
____________________________________________________________


Robert Bonomi wrote on Fri-09-Nov 12  9:32AM
:0c:
{
:0c:
backup
:0f
| rm $MAILDIR/last
:0:
last
}


try ':0fw' instead of ':0f'.  Must 'wait' for the pipe to complete, before
starting the next recipe.

Thanks Robert, alas, it is still not playing nice. Nothing I 
try leaves any (non-white) data in the folder last.

D'oh!  of course not!

The 'c' flag on the 'rm' recipe, causes it to be executed _in_parallel_
with following recipes.

try: 
 :0c:
 {
   foo=`rm $MAILDIR/last`
   :0c:
   backup
   :0:
   last
 }

Any ideas how to have the last and only the last email 
always living in that folder.

There's always:
  :0c : last
  | tee -a $MAILDIR/backup > $MAILDIR/last

to replace the entire gubbage you were using.

It's clearer, =and= somewhat faster, than your way.


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

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