Original Usenet thread from alt.ascii-art, started 19 Apr 1995.
_ _ _ _ _ _ | | | |___ ___ _ __ ___| |_ / \ _ __ ___| |__ (_)_ _____ | | | / __|/ _ \ '_ \ / _ \ __| / _ \ | '__/ __| '_ \| \ \ / / _ \ | |_| \__ \ __/ | | | __/ |_ / ___ \| | | (__| | | | |\ V / __/ \___/|___/\___|_| |_|\___|\__| /_/ \_\_| \___|_| |_|_| \_/ \___|
Software: Perl Script, Random Signatures.
alt.ascii-art
· 11 messages · 19 Apr 1995 - 4 May 1995
Right, I've had so many requests for this one, I decided to post it as well.
There are some notes missing at the bottom, which I will try to fill in
as best I can:)
Hope ye's all like it now...
-----------------------[Cut Here]-------------------------
#!/usr/local/bin/perl
#######
# Randomizes your sig by copying a random sig file
# from $HOME/sigs/ into $HOME/.signature
#
# be sure to change $home to your home directory path
# and to change the @files line if you use a different path structure
#
# the file defined in $base will be put into the sig file,
# then the random sig will be appended to it.
# if you want to use this feature, be sure to uncomment the `cat base` line
#######
$home = "/users/u3/lbedford"; # this line defines the users home dir
#$base = "$home/randsigbase"; # this defines where the base file is
srand(time|$$); # this makes random numbers happen
@files = <$home/randsigs/*>; # this is the path to the sigs dir
$this = $files[rand(@files)]; # this picks a random file from the
# sigs dir (see also (3) below)
#`cat $base > $home/.signature`; # see (1) below
`cat $this > $home/.signature`; # see (2) below
-----------------[Stop Here]---------------------------
Right, notes
First of all, change the directory in the first line to whatever is
relevant for your Unix installation... Ask your sys admin if you're not sure.
Second, change the $home=... line to point to your own home directory.
Thirdly, make sure you create a randsigs directory off your home
directory, do this by typing 'mkdir randsigs'.
lastly, the two points I cut off before.
(1) To make the script add a random ending to a constant signature, take
the # out from the beginning of this line, and change the '>' to '>>' in
the next line. This makes the script take the file 'randsigbase', copy
that to your signature, and append on a random ending.
(2) I think I covered this in point (1), basically, to get a random
ending, change the '>' to '>>'.
Have fun.
\ oo | Try me for dinner, I even wag my tail
\____|\mm | if you're nice to me, and like my jokes!!!
//_//\ \_\ | <Mail: lbe...@alf2.tcd.ie>
/K-9/ \/_/ | <WWW: http://alf2.tcd.ie/~lbedford/default.html>
/___/_____\ | <Voice Phone: Don't even try>
----------- | <Address: Don't be so nosy... >
The One & Only (in NUS!) HdBanger caught
Heidi (lbe...@alf2.tcd.ie) helpin... :
: Right, I've had so many requests for this one, I decided to post it as well.
: There are some notes missing at the bottom, which I will try to fill in
: as best I can:)
: Hope ye's all like it now...
[script cleared]
I've tried out the script... But the random effect can't appear... The
same old sig keep appearin instead of changin...
Or is the machine only choosin the same number??... hehehe...
Anyone willin to help me on this??... Thanx in advance...
And one more thing... How to I execute the script??... ie do I just place
the script in the rc file or in the login file... Or somethin else??...
--
********** <Lawrence Lim a.k.a HdBanger fba...@leonis.nus.sg> **********
` ... Life plan out before my birth, nothing could I say
Had no chance to see myself, moulded day by day... '
/ <DISPOSABLE HEROES> \
\ / _ _ _ _ _ _ _ \
/ \/ | | | /| | | | / \ | \
/ | |-- | /--| | | | | |- - -\
/ | |_ _ | / | |_ _ |_ _ | \_ _/ | \
/ DISCLAIMER : You know the usual; So TAKE IT or LEAVE IT !! \
** <Faculty of Business Administration, National University of Singapore> **
Lawrence Lim <fba...@cobra.nus.sg> wrote: >[script cleared] >I've tried out the script... But the random effect can't appear... The >same old sig keep appearin instead of changin... >Or is the machine only choosin the same number??... hehehe... >Anyone willin to help me on this??... Thanx in advance... >And one more thing... How to I execute the script??... ie do I just place >the script in the rc file or in the login file... Or somethin else??... You execute the script by simply typing in its name in your shell, i.e.: sigscript That's it. If you want to see the changes made automagically on every post, then add the following line to your .login file: setenv NEWSPOSTER '~/sigs/sigscript\;Pnews -h %h' where ~/sigs/sigscript is the full path and name of the script. L8er... -Eric (happily using a random .sig) :> -- URL- http://www.engr.wisc.edu/~agnew (/pumpkin.html) | SP FAQ maintainer :) "In the beginning, everything was very young." -Mark M, "Aggravating Answers to Annoying Questions"
Lawrence Lim <fba...@cobra.nus.sg> wrote: >[script cleared] >I've tried out the script... But the random effect can't appear... The >same old sig keep appearin instead of changin... >Or is the machine only choosin the same number??... hehehe... >Anyone willin to help me on this??... Thanx in advance... >And one more thing... How to I execute the script??... ie do I just place >the script in the rc file or in the login file... Or somethin else??... You execute the script by simply typing in its name in your shell, i.e.: sigscript That's it. If you want to see the changes made automagically on every post, then add the following line to your .login file: setenv NEWSPOSTER '~/sigs/sigscript\;Pnews -h %h' where ~/sigs/sigscript is the full path and name of the script. L8er... -Eric (happily using a random .sig) :> -- URL- http://www.engr.wisc.edu/~agnew (/pumpkin.html) | SP FAQ maintainer :) "In the beginning, everything was very young." -Mark M, "Aggravating Answers to Annoying Questions"
On 22 Apr 1995, Bob Allison wrote: > You execute the script by simply typing in its name in your shell, i.e.: > sigscript Pardon me... But I've no knowledge of C lang ... So these Unix cmds will not make too much sense to me... > That's it. If you want to see the changes made automagically on every post, > then add the following line to your .login file: > > setenv NEWSPOSTER '~/sigs/sigscript\;Pnews -h %h' > > where ~/sigs/sigscript is the full path and name of the script. What does the Pnews mean??... For my newsgrps I use somethin called tin... So what are the neccessary amendments??... Also when I tried doin a `sh' on the file there's an error on the line with srand... Says somethin bout unexpected... Perl gives no err.. but then the random feature is still not invoked... 8PP... Thanx for any help... Oh BTW... Does this work in pine (ie email??)... Just asked... If I can sort out the mess for tin... I might work on pine as well... ***** <Lawrence Lim aka HdBanger http://metro.turnpike.net/HdBanger/> ***** ` ... Life plan out before my birth, nothing could I say Had no chance to see myself, moulded day by day... ' / <DISPOSABLE HEROES> \ \ / _ _ _ _ _ _ _ \ / \/ | | | /| | | | / \ | \ / | |-- | /--| | | | | |- - -\ / | |_ _ | / | |_ _ |_ _ | \_ _/ | \ / DISCLAIMER : You know the usual; So TAKE IT or LEAVE IT !! \ ** <Faculty of Business Administration, National University of Singapore> **
In article <3nbtpi$bh...@gagme.wwa.com> you wrote:
: You execute the script by simply typing in its name in your shell, i.e.:
: sigscript
: That's it. If you want to see the changes made automagically on every post,
: then add the following line to your .login file:
: setenv NEWSPOSTER '~/sigs/sigscript\;Pnews -h %h'
: where ~/sigs/sigscript is the full path and name of the script.
Thanx... 8)).. Will mail if anymore probs... 8))...
--
********** <Lawrence Lim a.k.a HdBanger fba...@leonis.nus.sg> **********
` ... Life plan out before my birth, nothing could I say
Had no chance to see myself, moulded day by day... '
/ <DISPOSABLE HEROES> \
\ / _ _ _ _ _ _ _ \
/ \/ | | | /| | | | / \ | \
/ | |-- | /--| | | | | |- - -\
/ | |_ _ | / | |_ _ |_ _ | \_ _/ | \
/ DISCLAIMER : You know the usual; So TAKE IT or LEAVE IT !! \
** <Faculty of Business Administration, National University of Singapore> **
Lawrence Lim <fba...@leonis.nus.sg> wrote: >On 22 Apr 1995, Bob Allison forwarded: >> You execute the script by simply typing in its name in your shell, i.e.: >> sigscript >Pardon me... But I've no knowledge of C lang ... So these Unix cmds will not >make too much sense to me... It's not in C. It's a Perl script. There's no compiling it or anything. Just save it as a file and make sure it's executable. This can be done by typing: chmod u+x sigscript at your shell prompt. The shell prompt is what's there when you're not running tin or pine or something... :) It usually displays the terminal number followed by a % or $, depending on the shell type. Mine says "hp-100% ". Think of it as the equivalent of a DOS prompt... :) > That's it. If you want to see the changes made automagically on every post, >> then add the following line to your .login file: >> setenv NEWSPOSTER '~/sigs/sigscript\;Pnews -h %h' >What does the Pnews mean??... For my newsgrps I use somethin called >tin... So what are the neccessary amendments??... It's the same. Pnews is the actual program called by tin (or trn, which I use, or pretty much any other newsreader) that injects the article into the news stream. I guess you can think of your newsreader as a program that manipulates other programs: it loads articles, displays them (usually using the "more" cmd) and allows you to reply, using whatever editor you choose (i.e. vi, emacs...) and then using the posting program (Pnews). >Also when I tried doin a `sh' on the file there's an error on the line >with srand... Says somethin bout unexpected... Perl gives no err.. but >then the random feature is still not invoked... 8PP... Hmmm... Are you just typing the name of the script? As in "sigscript" by itself? It should work, then, since the first couple lines (with the perl path in it) tell it what to run it from (perl)... Try "cat .signature", then run the script, then cat your .sig again and see if it's different- it should be... <shrug> >Oh BTW... Does this work in pine (ie email??)... Just asked... If I can >sort out the mess for tin... I might work on pine as well... It should... I don't know the env to set for it to work automagically, like the setenv NEWSPOSTER line, but I'm sure there is one somewhere... <?> Hmm. You could always execute the randomizer from within Pine by doing a shell escape- just type "!sigscript" (if you're in a different directory, you might have to supply the path, too, i.e. "!~/sigs/sigscript"). The ! is the shell-escape command, so it'll run whatever you type after it as if you were in your shell instead of in Pine... You can do this from anywhere else, too, like tin... About the only other thing I can think of is you have to set your Pine options to have it include your signature. Or you could do it manually (insert it with your editor). Anything else? :> L8er... -Eric (not realizing he'd be giving out UNIX advice already...) :> -- URL- http://www.engr.wisc.edu/~agnew (/sp.html) | Smashing Pumpkins FAQ mtnr. "Reoccuring living bad dreams, at the vortex of lost souls, wailing lost souls of shame..." -SP, Spaced
I just wanted to say that me being the _originator_of this lot, by posting the script... I put the name of the script in my .login, (not sure what this is for other UNICES, I'm on DEC OSF) and then it changes every time I login... I don't know whether ppl want a different one each time, I'm quite happy with one signature for my set of postings from that login... Oh well... as the guy before said Liam(who definitely didn't think about giving advice on UNIX)<g> I am the butterfly, spread my coloured wings, I am the butterfly, spred my coloured wings, I am the butterfly, and I'm going slightly mad!!!! <address>lbe...@alf2.tcd.ie</address> <a href="http://alf2.tcd.ie/~lbedford/index.html">Come and see me</a>
I haven't read my mail for a few days, so have missed this PERL script.
Please could you either resend it to the newsgroup, or direct to me ?
__ I~~~~~~~~~I _____________________
I[]I I o o o o I /\ |\ \ \ \ \ \
I~~I I o o o o I / \ | \ \ \ \ \ \
I I I o o o o I /----\ | \ \ \ \ \ \
I I I I / \ \ \ \ \ \ \ \
I__I I o o o o I /\ /\ \ \ \ \ \ \ \
|| .-. I o o o o I / \ / \ \ |~~~~~~~~~~~~~~~~~~~~|
I~~~~~~~~~~~~~~I I I / \ / \ \ | am...@coventry.ac.uk |
I______________I I TOSHIBA I / \/ \ \|____________________|
^ ^ I_________I ANDREW MURPHY BSc Comp Sci 1st Year Cov. Uni
Since it's been asked for again, here it is:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#!/usr/bin/perl
$home = "/path/to/your/home/directory";
srand(time|$$);
@files = <$home/sigs/data/*>;
$this = $files[rand(@files)];
`cp $home/sigs/header $home/.signature`;
`cat $this >> $home/.signature`;
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
where the second line includes the full path to your home directory in quotes,
sigs/data is the directory within your home dir that has all your files in it,
sigs/header is the first main part of your .sig which is the same every time.
To have it change every time you log in, just put the name of the script as a
line in your '.login' file. To have it change every time you post a message,
add the following line to your .login file:
setenv NEWSPOSTER '~/sigs/sigscript\;Pnews -h %h'
To see the effects of this in action, just check out my .sig below this. The
"header" file contains the first line, with the URL, and the rest will be a
random file from the data directory...
L8er...
-Eric
--
URL- http://www.engr.wisc.edu/~agnew (/sp.html) | Smashing Pumpkins FAQ mtnr.
"Everybody's a liar, I don't trust anyone..." -SP, Silverfuck(live)
If anybody is interested, I have a Perl script that will rotate your sig (date sequentially - not randomly), but rather than actually copying the file, it just makes a symbolic link. Anybody interested, just email me... -Me ego...@unh.edu Col...@unh.edu col...@ctron.com
Related ASCII art in the Gallery
Explore these categories from our collection of 11,000+ artworks:
,sSSs ,SSSS_/ ,_ sS/`))\// sS//|_(_/ _, SS\\\ `""-.-'` / sSS` jgs-==-'`'-._\
___________ | _______ | | | | | | | | | | | | | | |_______| | |___________|
//O\\
|\/\/\/| | | | | | (o)(o) C _) | ,___| | / /____\
|HHHHH/"\"\HHHHHHH| |HH`\|_.-)'|/'dP,H| |Hb.`\\_/_//'.oddH| |HHHb|`.\/\,'|HHHH| |HHHHHb/\/\/|HHHHH| |"""""""""""""""""| | |"" /\ \ / |"" | | |__/--\ \/ __| |
_________
/___ ___\
//@@@\ /@@@\\
\\@@@/ \@@@//
\___ " ___/
| - |
\_/ jrjc Make your own ASCII art
Turn images, text or 3D into ASCII, or draw your own – right in your browser.
About this thread.
These messages were posted publicly to the newsgroup
alt.ascii-art
in 1995 and are 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 one of the authors? 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.