On Tue, May 08, 2001 at 01:15:59PM +1000, Michael Lake ([EMAIL PROTECTED]) wrote:
> Hi guys,
>
> Sometime ago someone posted (Jeff?) a script which you can set to run in
> muttrc that runs fortune and sets the output into your sig. From what I
> remember it wrote a sig to tmp and then used that. Have searched slug
> archives for that with keywords mutt, quote, sig but can't find it. Can't
> search woa at present or indeed slug again at moment as web is down, the
> UTS can't seem to resolve any sites. The rain?
here's another solution:
make a ".signature" file like this:
------------------------------------------------------------
%QUOTE%
put whatever you like here what needs to be STATIC.
------------------------------------------------------------
then make a file called ".signature.quotes", add as many as you
like separated by a line. Note the last line must not have
a carriage return.
------------------------------------------------------------
Student to Teacher: Sir, what's an oxymoron? Teacher to Student: Microsoft security.
If love is blind, why is lingerie so popular?
Why are a wise man and a wise guy opposites?
------------------------------------------------------------
then make a script called ".signature.pl"
------------------------------------------------------------
#!/usr/bin/perl
if($#ARGV lt 0 or $#ARGV gt 2) {
print "Usage: $^X sigfile [quotefile]\n";
exit 1;
}
# determine the quote
if ($#ARGV eq 1) {
open (FI, "$ARGV[1]") or die "Can't open $ARGV[1]";
# count the quotes
$sig[0] = 0;
while(<FI>)
{
$sig[$#sig + 1] = tell if /^$/;
}
# read one
srand;
seek(FI, $sig[int rand ($#sig + .9999)], SEEK_SET) or die "Can't seek";
# seek(FI, $sig[0], SEEK_SET) or die "Can't seek";
$msg = <FI>;
while (<FI>) {
last if /^$/;
$msg .= $_;
}
}
open (SIG, "$ARGV[0]") or die "Can't open $ARGV[0]";
while (<SIG>) {
$_ =~ s/%QUOTE%/$msg/;
print "$_";
}
------------------------------------------------------------
in your .muttrc you place the following line:
-----------------------------------------------------------
set signature = "/PATHTOYOURHOMEDIRECTORY/.signature.pl ~/.signatureforquotes
~/.signature.quotes|"
-----------------------------------------------------------
and from then one you signature will change automaperly!
jobst
>
> Mike
> --
> Michael Lake, University of Technology, Sydney
> Email: [EMAIL PROTECTED] Ph: 02 9514 1724 Fx: 02 9514 1628
> URL: http://www.science.uts.edu.au/~michael-lake/
> Linux enthusiast, active caver and interested in anything technical.
> ***************************************
>
>
>
> --
> SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
> More Info: http://lists.slug.org.au/listinfo/slug
--
Approach love and cooking with reckless abandon.
| __, Jobst Schmalenbach, [EMAIL PROTECTED], Technical Director|
| _ _.--'-n_/ Barrett Consulting Group P/L & The Meditation Room P/L |
|-(_)------(_)= +61 3 9532 7677, POBox 277, Caulfield South, 3162, Australia|
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug