On Wed, May 09, 2001 at 04:45:26PM +1000, Jobst Schmalenbach wrote:
> 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"
> ------------------------------------------------------------
[... long perl script deleted ...]

This is very much in the 'me too' vein, but I get the same effect from
a ten line shell script (and that's a blank line included in the count).
Of course, it wins no prizes in the "immediately obvious how it works"
category. :-)

----------------------------------------------
#! /bin/sh
# The next line has a newline immediately after the quote.
IFS='
'
sigfile="/home/malcolm/Mail/signature-lines"
lines=($(cat $sigfile))
length=$(wc -l < $sigfile)

echo static stuff goes here ...
echo ${lines[$(($RANDOM % $length))]}
----------------------------------------------

So who said Perl was only for writing short unintelligible scripts?
Looks like you can write long unintelligible scripts with it as well.
:-)

/me runs for cover.

Cheers,
Malcolm

-- 
Despite the cost of living, have you noticed how popular it remains?

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to