Re: send-hook executing externel unix command

2000-02-24 Thread Mikko Hänninen

Markus Fischer <[EMAIL PROTECTED]> wrote on Thu, 24 Feb 2000:
> [from ~/.muttrc]
> send-hook '.*' '`generate_new_signature.pl`'

I suggest you write this as:

  set signature="generate_new_signature.pl|"

This will invoke the perl script every time a signature is needed, read
its output, and use that for the signature.  Your script can modify
.signature (or whatever other files) you want, but it doesn't really
have to, as only the output will be used in this case by Mutt.  This
way, you don't even need a hook.

It *is* possible to do it like you're trying to do it...  Something like

  send-hook . 'push generate_new_signature.pl\n'

Using "push cmd\n" is the right way to do it here, not
using backtics, those though could be kludged to work as well by having
no output, or something like "push " or whatever...

But, really, I recommend just setting the signature to be a pipe from
your script. :-)


Regards,
Mikko

PS. Please use [EMAIL PROTECTED] when writing to the list (not the
gbnet.net address, despite what the welcome email might say).
-- 
// Mikko Hänninen, aka. Wizzu  //  [EMAIL PROTECTED]  //  http://www.iki.fi/wiz/
// The Corrs list maintainer  //   net.freak  //   DALnet IRC operator /
// Interests: roleplaying, Linux, the Net, fantasy & scifi, the Corrs /
Reality is for people who can't cope with the Internet.



send-hook executing externel unix command

2000-02-24 Thread Markus Fischer


Hi all,

lately I tried to write a send-hook like this :

[from ~/.muttrc]
send-hook '.*' '`generate_new_signature.pl`'

It calls 'generate_new_signature.pl', which overwrite
~/.signature so I have a new signature every time a send a new
mail (I allready realized that send-hook gets exectued at least
two timeswhen sending a mail, but thats no problem since those
signatures are randomly choosen from a set of files anyway).

But mutt than complains about ": ", because it
expects that stdout from generate_new_signature.pl generates a
valid mutt command. I now set the outout to "set sort=threads"
because its my default sort option I have everywhere, but I would
like to know how to execute a command without haveing to fidle
with the stdout.

Thanks for your time !

kind regards,
Markus
-- 
Markus Fischer,  http://josefine.ben.tuwien.ac.at/~mfischer/
EMail: [EMAIL PROTECTED]
PGP Public  Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1  C2B5 D674 B445 C227 2BD0
- Free Software For A Free World -

 PGP signature