Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Mutt and setting pithy single line quotes in sig :-)


On Wed, May 09, 2001 at 03:20:38PM +0800, Malcolm Tredinnick (malcolm@xxxxxxxxxxxxxxxxx) wrote:
> On Wed, May 09, 2001 at 04:45:26PM +1000, Jobst Schmalenbach wrote:
> > here's another solution:

[snip]

> 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.
> :-)

There is nothing wrong with what you said (and did). I wrote that script 
yonks ago with people in mind who needed some "error output" to help them
to get the script going and to give them some error reports in case they
did something wrong. If you chop it down to the guts you end up with a
4 liner (with a pipe in muttrc), unreadable for most people, this was 
NOT my aim.


... and you dont have to run for cover ;-)


jobst


-- 
Why don't sheep shrink when it rains?

|            __, Jobst Schmalenbach, jobst@xxxxxxxxxxxxxx, Technical Director|
|  _ _.--'-n_/   Barrett Consulting Group P/L & The Meditation Room P/L      |
|-(_)------(_)=  +61 3 9532 7677, POBox 277, Caulfield South, 3162, Australia|