procmail
[Top] [All Lists]

Simple Recipe

2001-06-10 23:39:16
It would seem this ought to be simple...

A shell script outputs e-mail with a subject line containing a specific
string of characters, followed by a space, followed by the hostname where
the script executes.

I want to extract the hostname from the subject line and save the message in
a folder named for the host:

SUBJ=`/opt/sfw/bin/formail -xSubject:`

:0:
* (^SUBJECT:.*)myspecificstringofcharacters.*
HOST=`/usr/bin/echo \"${SUBJ}\" | /usr/bin/awk '{print $NF}'`
$HOST

This is saving the message, but the folder name is in fact "HOST=hostname"
(i.e.,
"HOST=" is a literal, while the correct hostname is appended).

Thanks.
--
Tim Evans, T.Rowe Price Investment Technologies  | 
tkevans(_at_)troweprice(_dot_)com
P.O. Box 89000                                   | (410) 345-8134
Baltimore, MD 21289-0374                         | (410) 345-8150 (Fax)
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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