Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet message from alt.ascii-art, 18 Dec 1994.
Re: Anyway to randomize sig files?

Re: Anyway to randomize sig files?

>>>>> "Eli" == Eli the bearded <bgr...@ic.sunysb.edu> writes:

Eli> Note cross posting.
Eli> In article <3csckl$br...@lastactionhero.rs.itd.umich.edu>,
Eli> kna...@cochrane.bus.umich.edu (Kent Stefl Nassen) writes:
>>> *] >        Can someone tell me if there is a way to randomize sig files?
>> Here is a perl script I grabbed from somewhere.  It was originally set
>> up to put random one-line quotes in your .sig, but I modified it to
>> just randomize a group of .sig files.  Very simple.  I use it with pine
>> by aliasing pine to 'randsig; pine'.  Then, whenever pine is run, you
>> will get a random sig.  You can use the same aliasing trick for other
>> programs, assuming your shell allows aliases.

Eli> 	#!/location/of/perl
	
Eli> 	$home = "/your/home/directory";
Eli> 	srand(time|$$);
Eli> 	@files = <$home/sigs/*>;
Eli> 	$this = $files[rand(@files)];
	
Eli> 	`cp $this $home/.signature`;
	
Eli> Anybody either have or can quickly modify this to
Eli> be more friendly to the inode-imparied? My site has the
Eli> absurd idea that I should only have 800 files. At this
Eli> moment I am about 100 away from the limit. Lots of extra
Eli> files will not help. Putting all the files in a cpio or
Eli> ar archive would be great. Creating a new file format for
Eli> this is fine as well.

Well, put them all in the perl program then:

	#!/usr/bin/perl
	srand(time ^ $$); # not |, which loses information
	$/ = "\n%%\n";
	@sigs = <DATA>;
	open(SIG, ">.signature");
	print SIG $sigs[rand(@sigs)], "\n";
	__END__
	Here's a sig
	and it can have multiple lines
	%%
	Here's the second sig
	and it too
	can have multiple lines
	%%
	Here's another sig that has %% somewhere in it.
	%%
	And here's another sig.  Really!

There.  It's just one file, with the data in the program.  Perl is
Your Friend.

print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <mer...@stonehenge.com> Snail: (Call) PGP-Key: (finger mer...@ora.com)
Phrase: "Welcome to Portland, Oregon ... home of the California Raisins!"

Original message headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1012a6,29a923fbbd8ba89c
X-Google-Attributes: gid1012a6,public
X-Google-Thread: f996b,1bf4e46a52a72b7b
X-Google-Attributes: gidf996b,public
X-Google-ArrivalTime: 1994-12-17 17:20:08 PST
Path: nntp.gmd.de!dearn!blekul11!idefix.CS.kuleuven.ac.be!ub4b!EU.net!howland.reston.ans.net!
 europa.eng.gtefsd.com!library.ucla.edu!psgrain!rainrgnews0!news.teleport.com!usenet
From: mer...@stonehenge.com (Randal L. Schwartz)
Newsgroups: alt.ascii-art,comp.unix.shell
Subject: Re: Anyway to randomize sig files?
Date: 18 Dec 1994 00:15:28 GMT
Organization: Stonehenge Consulting Services; Portland, Oregon, USA
Lines: 59
Message-ID: <MER...@linda.teleport.com>
References: <345...@student.msu.edu> <3cppfl$mc...@cronkite.seas.gwu.edu>
	<3csckl$br...@lastactionhero.rs.itd.umich.edu>
	<3cv671$sn...@adam.cc.sunysb.edu>
Reply-To: mer...@stonehenge.com
NNTP-Posting-Host: linda.teleport.com
In-reply-to: bgr...@ic.sunysb.edu's message of 17 Dec 1994 17:13:05 GMT
Xref: nntp.gmd.de alt.ascii-art:18179 comp.unix.shell:17843

Related ASCII art in the Gallery

Explore these categories from our collection of 11,000+ artworks:

About this message. This message was posted publicly to the newsgroup alt.ascii-art in 1994 and is mirrored here unchanged as part of the Historic Archives – only email addresses are masked. The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can. Are you the author? Contact us to get your posts attributed, connected to your artist profile, or removed.

Report this message

Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.

Help classify this post