Re: random header script?

2002-06-24 Thread darren chamberlain
* Thomas Hurst [EMAIL PROTECTED] [2002-06-23 08:00]: If you still want to use a script but don't want to eat filesize * structure overhead and IO every invocation, you'll want to seek to somewhere random in the file and read until you get a complete line, ala (in Ruby): begin

Re: random header script?

2002-06-23 Thread Thomas Hurst
* Ken Weingold ([EMAIL PROTECTED]) wrote: I think I remember a while back someone haveing a script to take lines randomly from a text file to put into a custom header. Does anyone have this? Replace \n with \n%\n and run it through strfile. Then run fortune over the generated data file.

Re: random header script?

2002-06-21 Thread Ken Weingold
On Thu, Jun 20, 2002, David T-G wrote: % One issue. It seems to run the script only once, when I start mutt, so I always RTFArchives, grasshopper :-) I tried, but 1) the mutt site was down last night, and 2) I couldn't even think of what to search for. I tried a few things in Google, but

Re: random header script?

2002-06-21 Thread Ken Weingold
Okay, so here's a purely aesthetic question. Using send-hook works just fine, but it puts the header after all my my_hdr's. Anyway to get it before them? -Ken

Re: random header script?

2002-06-21 Thread Charles Krug
On Fri, Jun 21, 2002 at 08:36:43AM -0400, Ken Weingold wrote: On Thu, Jun 20, 2002, David T-G wrote: % One issue. It seems to run the script only once, when I start mutt, so I always RTFArchives, grasshopper :-) I tried, but 1) the mutt site was down last night, and 2) I couldn't

Re: random header script?

2002-06-21 Thread Rob 'Feztaa' Park
--r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Alas! Ken Weingold spake thus: Okay, so here's a purely aesthetic question. Using send-hook works just fine, but it puts the header after all my my_hdr's.

Re: random header script?

2002-06-21 Thread David T-G
Ken -- ...and then Ken Weingold said... % % On Thu, Jun 20, 2002, David T-G wrote: ... % % RTFArchives, grasshopper :-) % % I tried, but 1) the mutt site was down last night, and 2) I couldn't Of course, the archives don't live there, so all you really need to do is use google to find a

Re: random header script?

2002-06-21 Thread Ken Weingold
On Fri, Jun 21, 2002, David T-G wrote: BTW, you may find that my_hdr 'X-Message-Flag: `$HOME/bin/random.pl`' will still work -- and then you'll have the simple answer to your question of aesthetics :-) Try playing with it... With single or double quotes like that, it gets eaten and

Re: random header script?

2002-06-21 Thread Ken Weingold
On Fri, Jun 21, 2002, AxUm wrote: I think I remember a while back someone haveing a script to take lines randomly from a text file to put into a custom header. I usually use fortune ... fortune -o is more fun. :) -Ken

random header script?

2002-06-20 Thread Ken Weingold
I think I remember a while back someone haveing a script to take lines randomly from a text file to put into a custom header. Does anyone have this? Basically I want to insert into that Outhouse header random lines from a text file I made from the Surrealist Compliment Generator. :) Thanks.

Re: random header script?

2002-06-20 Thread Rob 'Feztaa' Park
Alas! Ken Weingold spake thus: I think I remember a while back someone haveing a script to take lines randomly from a text file to put into a custom header. Does anyone have this? Basically I want to insert into that Outhouse header random lines from a text file I made from the Surrealist

Re: random header script?

2002-06-20 Thread Dan Boger
On Thu, Jun 20, 2002 at 02:49:37PM -0600, Rob 'Feztaa' Park wrote: This is trivial to do in perl: open FILE, file.txt; while (FILE) { push lines, $_; } print $lines[int(rand(lines))]; or, the more efficient way: open FILE, file.txt or die $!; rand($.) 1 ($line = $_)

Re: random header script?

2002-06-20 Thread Ken Weingold
Thanks for the quick replies. It works. Too cool. -Ken

Re: random header script?

2002-06-20 Thread Rob 'Feztaa' Park
--RIYY1s2vRbPFwWeW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Alas! Dan Boger spake thus: On Thu, Jun 20, 2002 at 02:49:37PM -0600, Rob 'Feztaa' Park wrote: This is trivial to do in perl: =20 open FILE, file.txt; =20

Re: random header script?

2002-06-20 Thread Ken Weingold
On Thu, Jun 20, 2002, Rob 'Feztaa' Park wrote: Sure, that works; but you can't repeat it without rewinding to the beginning of the file. With mine, you can call that print statement as many times as you want ;) One issue. It seems to run the script only once, when I start mutt, so I always

Re: random header script?

2002-06-20 Thread David T-G
Ken -- ...and then Ken Weingold said... % ... % One issue. It seems to run the script only once, when I start mutt, so I always RTFArchives, grasshopper :-) % get the same line from the file. Do I not have the correct syntax for % it? This is my header: % % my_hdr X-Message-Flag: