Everything2
Near Matches
Ignore Exact
Full Text
Everything2

How to get a pseudo random .signature

created by bis

(idea) by bis (1.4 mon) (print)   ?   (I like it!) 1 C! Wed Aug 23 2000 at 21:36:33

well, this is the way I do it, after reading whois' writeup on "I am not a hacker", and deciding to finally ditch the awk/csh frankenstein-looking scripts that I wrote in the first semester of my freshman year of college, before I knew much about Unix and Perl. (don't worry, I am not going to node that monstrosity, at least until someone asks me to...)

#!/usr/local/bin/perl
$H=$ENV{"HOME"};
open SL, "$H/.siglist" or die; 
open SD, "$H/.sigdefault" or die;
open SIG, ">$H/.signature" or die;

srand();

$/="";

while(<SL>)
{
   if( rand($.)<1 ) { $x=$_ }
}

chomp $x;
print SIG "$x\n";

$x=<SD>;
print SIG $x

as a note, ~/.siglist is in the form of

"pithy quote"
       -- Source

"another pithy quote"
       -- An Unlikely Source

... (more mighty fine quotes) ...
and my ~/.sigdefault (which is somewhat of a misnomer; ".sigtail", or something, might have been more appropriate) is:
------------------
Benjamin Strautin
bis@alumni.duke.edu
(DOH! you've tricked me into giving out my email address!)


printable version
chaos

I am not a hacker The almighty horrible node apology random number generator $_
/usr/local Abort, Retry, or Fail? email address For my last trick, I made her disappear
127.0.0.1 $HOME Perl How to improve your chances of having sex
/bin Fnorder Ask Me More Eeyore duke
alumni misnomer quote pithy
awk Unix monstrosity Tricky
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes to live by:
The Things They Carried
Learning a language
How to play the harmonica
a conversation with this, that, or the other god
Galileo Galilei
Infocom
23 Days in Bhutan
Arthur Conan Doyle
Somewhere, there's a universe with your name on it, spelled out in consecutive constellations
AC-130H/U Gunship
The Raven (The Edgar Allan Porn version)
I've had better hugs from wind gusts and dead people
bass
New Writeups
Timeshredder
The Texas UFO Crash of 1897(event)
Heitah
The Dark Knight(review)
ignis_glaciesque
Uppsala(place)
ignis_glaciesque
diffusion of responsibility(idea)
TheOrientalAfrican
The Soft Meadow of my Childhood(event)
BookReader
The Dragon Slayers(fiction)
kohlcass
religiously fashionable(review)
Pavlovna
waulking song(thing)
tentative
Stick Man(poetry)
Ereneta
The Fight with the Snapping Turtle: Or, the American St. George(poetry)
sitaraika
Fog and fire(personal)
MonoliTheory
She sobs in response(fiction)
kohlcass
Arzu(person)
Clarke
Duster(fiction)
mountain boy
Oscar Diaz v. Delvin Rodriguez(person)
Everything 2 is brought to you by the letter C and The Everything Development Company