On Mon, 30 Sep 2002, raphael wrote:
Hi there,
Now I hope you guy's don't start laughing out loud, but I'm just getting
involved with procmail since 2 month's and I'm cornered with a little
problem.
What I want to do is the following. I want to take the date from the Date
field of a message and use that to create a string in the format
yymmdd corresponding with the date of the message. This is what I got:
DATE=\"`formail -xDate:`\"
DATEFILE=`date -d $DATE +%y-%m-%d`
If I take a look at the log output I come up with:
procmail: Assigning "DATE=" Tue, 17 Sep 2002 19:22:12 +0100""
procmail: Executing "date,-d,",Tue,,17,Sep,2002,19:22:12,+0100",+%y-%m-%d"
date: too many non-option arguments
Try `date --help' for more information.
procmail: Assigning "DATEFILE="
It seems that the comma's in $DATE screw the whole thing up.
The commas are came to help you to see how the lines are changed
to "tokens" - this is the log output not your fault (:-) It will
help you to see that you have extra quotas. Now:
DATE=`formail -xDate:`
DATEFILE=`date -d "$DATE" '+%y-%m-%d'`
I did not try it, but this is the direction.
Bye,
Udi
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail