[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pine-info
Subject:    Rotating 'random' signatures.
From:       jdavis () CS ! Arizona ! EDU (Jim Davis)
Date:       1994-05-31 17:54:08
[Download RAW message or body]

Someone's bound to ask sooner or later, so here's a simple approach to
getting a different signature, chosen at 'random', each time you start
up pine.  (Getting a random signature each time you enter pine's
composer is also possible, but more complicated.)  This is for a UNIX
system; I tested it on a Sun workstation running Solaris 2.3:

-------------------------snip snip snip--------------------------------------
#!/bin/sh -

pinesig=$HOME/.pinesig          # what 'signature-file=' is in your .pinerc
realpine=/usr/local/bin/pine    # pathname to the real pine executable
sigfile=$HOME/sigs              # pathname to your file of signatures

#
# Write a 'random' signature to signature-file:
#

/bin/nawk 'BEGIN { RS=""}
                 { sigs[NR] = $0 }
           END   { srand(); print sigs[randint(NR)]}
#	   END   { srand(); print "--"; print sigs[randint(NR)]}
         function randint(n) { return int(n * rand()) + 1}' <$sigfile >$pinesig
#
# Now run the real pine executable
#

exec $realpine
-------------------------snip snip snip--------------------------------------

Call the script 'pine' and put it somewhere in your $PATH ahead of the
real pine executable.  The script uses awk to suck in a file of
signatures; each signature is separated by a blank line, like so:

Jim Davis               | "Get the telescope out of the hall closet, Ed."
jdavis@cs.arizona.edu   |  -- Mrs. Bighead

Jim Davis               | "1.1, 1.2, 1.3, let's rock!"
jdavis@cs.arizona.edu   |   -- Elma 'Cooder' Fingerwood

Jim Davis               | "I love making him do that."
jdavis@cs.arizona.edu   |   -- Clarissa Darling

awk stores the sigs in an array, and then chooses one at 'random' and
writes that to your signature-file.  Once that's done, the script
calls the real pine program.

If you want your signature preceded by a "--" line, the way (t)rn
does, then uncomment the second END statement (and comment out the
first).

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic