Original Usenet thread from rec.arts.ascii, started 25 Sep 1994.
_ _ _ _ _ _ | | | |___ ___ _ __ ___| |_ / \ _ __ ___| |__ (_)_ _____ | | | / __|/ _ \ '_ \ / _ \ __| / _ \ | '__/ __| '_ \| \ \ / / _ \ | |_| \__ \ __/ | | | __/ |_ / ___ \| | | (__| | | | |\ V / __/ \___/|___/\___|_| |_|\___|\__| /_/ \_\_| \___|_| |_|_| \_/ \___|
Request: Signature insertion in tin
rec.arts.ascii
· 18 messages · 25 Sep 1994 - 12 Oct 1994
+------ Ryan Tucker (rtu...@worf.infonet.net) wrote: ----------- | | If you're using "tin", there's a way to have tin randomly select a sig | out of a directory. If anyone's interested, I can take a clip out of the | man page :-) Could you please do this. I am using "tin" but have no man page for it. Thanks in advance, Dave. -- _ PROGRAM (pro'-gram) [n] A magic spell cast over a .----. . - . computer allowing it to turn one's input into error |C>_.|.:'.:. . messages. [vi] To engage in a pastime similar to _|____|_ `:. O_/ banging one's head against a wall, but, with fewer | --| \/M opportunities for reward. (dis...@nunic.nu.edu) `-######-'a _/ \_
David S. Issel (dis...@nunic.nu.edu) wrote: > +------ Ryan Tucker (rtu...@worf.infonet.net) wrote: ----------- > | > | If you're using "tin", there's a way to have tin randomly select a sig > | out of a directory. If anyone's interested, I can take a clip out of the > | man page :-) Simply create a directory in your $HOME directory called .Sig Any file in that directory will be in the list that tin will use to randomly select a signature. Also, if you create a file in your $HOME called .sigfixed, that file will ALWAYS be included above your random sig. Have fun! -- ..ooooOOOOoooo....ooooOOOOoooo....ooooOOOOoooo....ooooOOOOoooo....ooooOOOOoooo .__ Danni Bauer | \ _.._ ._ * bau...@gtetel.com |__/(_][ )[ )| 737...@compuserve.com
Danni Bauer (bau...@gtetel.com) wrote:
: David S. Issel (dis...@nunic.nu.edu) wrote:
: > +------ Ryan Tucker (rtu...@worf.infonet.net) wrote: -----------
: > |
: > | If you're using "tin", there's a way to have tin randomly select a sig
: > | out of a directory. If anyone's interested, I can take a clip out of the
: > | man page :-)
: Simply create a directory in your $HOME directory called .Sig
: Any file in that directory will be in the list that tin will use
: to randomly select a signature. Also, if you create a file in your
: $HOME called .sigfixed, that file will ALWAYS be included above
: your random sig. Have fun!
Your signature directory doesn't even have to be name .Sig as long as
you tell tinrc where it is. I didn't know about the .sigfixed! That's
cool. THanks for the posting this info!
-Harry
.---. .----------- .__ __
/ \ __ / ------ _____ | | _____ _____| | _______
/ / \( `-, ----- \__ \ | | \__ \ / ___/ |/ /\__ \
////// '~ ( --- / __ \| |__/ __ \_\___ \| < / __ \_
//// / // : ; --- (____ /____(____ /____ >__|_ \(____ /
// / / /) / -- \/ \/ \/ \/ \/
/ //..\\ No bird soars too high, if he soars with his own wings
==========UU====UU======================- Harry Marlin -=====================
'//||\\` Ala...@gate.net
''``
Danni Bauer (bau...@gtetel.com) wrote:
: David S. Issel (dis...@nunic.nu.edu) wrote:
: > +------ Ryan Tucker (rtu...@worf.infonet.net) wrote: -----------
: > |
: > | If you're using "tin", there's a way to have tin randomly select a sig
: > | out of a directory. If anyone's interested, I can take a clip out of the
: > | man page :-)
: Simply create a directory in your $HOME directory called .Sig
: Any file in that directory will be in the list that tin will use
: to randomly select a signature. Also, if you create a file in your
: $HOME called .sigfixed, that file will ALWAYS be included above
}snip{
OK, but what call do you make to get a random selection???
i.e: I use [ESC] :r filename.sig
____ _ } Bruce Laplante
| ) -+-' I _|_ { Programmer of Computers
|-< _ _ _ | _ _ N _ _ | _ }-=-=-=-=-=-=-=-=-=-=-=-=-
| )/ L(_)_(__(/__ _|.(_(_|_)_X_(_(_| )_+_(/__ { "I think, therefore
---- (_/\__ | } I drink. You folla'?"
Bruce Laplante (ccb...@gatekeeper.ddp.state.me.us) wrote:
: Danni Bauer (bau...@gtetel.com) wrote:
: : David S. Issel (dis...@nunic.nu.edu) wrote:
: : > +------ Ryan Tucker (rtu...@worf.infonet.net) wrote: -----------
: : > |
: : > | If you're using "tin", there's a way to have tin randomly select a sig
: : > | out of a directory. If anyone's interested, I can take a clip out of the
: : > | man page :-)
: : Simply create a directory in your $HOME directory called .Sig
: : Any file in that directory will be in the list that tin will use
: : to randomly select a signature. Also, if you create a file in your
: : $HOME called .sigfixed, that file will ALWAYS be included above
:
: }snip{
: OK, but what call do you make to get a random selection???
: i.e: I use [ESC] :r filename.sig
All you have to do is post something and tin will randomly select a file
in you signature directory and put it at the end of the post.
-Harry
.---. .----------- .__ __
/ \ __ / ------ _____ | | _____ _____| | _______
/ / \( `-, ----- \__ \ | | \__ \ / ___/ |/ /\__ \
////// '~ ( --- / __ \| |__/ __ \_\___ \| < / __ \_
//// / // : ; --- (____ /____(____ /____ >__|_ \(____ /
// / / /) / -- \/ \/ \/ \/ \/
/ //..\\ No bird soars too high, if he soars with his own wings
==========UU====UU======================- Harry Marlin -=====================
'//||\\` Ala...@gate.net
''``
Bruce Laplante (ccb...@gatekeeper.ddp.state.me.us) wrote: > Danni Bauer (bau...@gtetel.com) wrote: > : David S. Issel (dis...@nunic.nu.edu) wrote: > : > +------ Ryan Tucker (rtu...@worf.infonet.net) wrote: ----------- > : > | > : > | If you're using "tin", there's a way to have tin randomly select a sig > : > | out of a directory. If anyone's interested, I can take a clip out of the > : > | man page :-) > : Simply create a directory in your $HOME directory called .Sig > : Any file in that directory will be in the list that tin will use > : to randomly select a signature. Also, if you create a file in your > : $HOME called .sigfixed, that file will ALWAYS be included above > > }snip{ > OK, but what call do you make to get a random selection??? > i.e: I use [ESC] :r filename.sig [cut out] You don't have to call anything; it's automatic. When I pressed 'f', it quoted the message, put my .sigfixed file and a random Sig file at the bottom and put me into the editor. All the stuff below here came automatically! vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ____ __ _ _ _ _ ____ ( _ \ /__\ ( \( )( \( )(_ _) Danni Bauer )(_) )/(__)\ ) ( ) ( _)(_ bau...@gtetel.com (____/(__)(__)(_)\_)(_)\_)(____) 737...@compuserve.com
Bruce ccb...@gatekeeper.ddp.state.me.us writes: > Danni Bauer (bau...@gtetel.com) wrote: >: David S. Issel (dis...@nunic.nu.edu) wrote: >:> +------ Ryan Tucker (rtu...@worf.infonet.net) wrote: ----------- >:>| If you're using "tin", there's a way to have tin randomly select a sig > > : Simply create a directory in your $HOME directory called .Sig > > : Any file in that directory will be in the list that tin will use > : to randomly select a signature. Also, if you create a file in your > : $HOME called .sigfixed, that file will ALWAYS be included above > > }snip{ > > OK, but what call do you make to get a random selection??? > i.e: I use [ESC] :r filename.sig Hmmmmm, Using a vi variant editor are we? The key note here is that: If (you are using **** TIN ****) then tin will select a random signature file automagically from your .Sig directory. .and. tin will prepend the file $HOME/.sigfixed to the signature file before appending the signature to your article. end if -- Rudrik '.sigs we don't need no stinking .sigs' GreyShadow
In article <36a2s8$bk...@sashimi.wwa.com> bau...@gtetel.com (Danni Bauer) writes: [...blah blah...]] >> OK, but what call do you make to get a random selection??? >> i.e: I use [ESC] :r filename.sig > >[cut out] > >You don't have to call anything; it's automatic. When I pressed 'f', it >quoted the message, put my .sigfixed file and a random Sig file at the >bottom and put me into the editor. > >All the stuff below here came automatically! Ok, a while back ('bout a month) I posted a little script I have made that gets a random sig. Somehow I don't think it got through (we have a rather bad news feed at times). In case it did and no-one liked it I won't post it again, but feel free to ask me for it. Basically it consisted of 3 files: - .signature (I use .sig but this is easily changed) - .sigs (a file containing all your signatures seperated by a &) - sigger (shell script that randomly grabs a sig from .sigs and puts it into the file .signature) Then all you do is set your mailer/etc. to load up the .sig file. Any interested parties? Tim: i92...@redgum.ucnv.edu.au --------------------------------------------------------------------- * TPot * "A word is worth one coin, Silence is worth two" * * . * * * (O~ * - the Talmud * --------------------------------------------------------------------- P.S. Currently working on a rough Random Dot Stereogram generator (ascii), anyone out there got any ideas? Heres a sample of what i have so far: UUUUU UUUUU TU TU T U T U SSSSSU SSSSS U SU SU S US U SUU SU S US UU S S ST ST SSSSS SSSSS P.P.S. Scarecrow... can you mail me an ACK if this gets through to you please :)
Does anybody out there know of a mailer that will put in a .sig at random ? (if not I suppose I can use tin to do my mailing) thanks -Hamish Were Oh Where has my .sig gone?
Hamish Currie (H.C...@mailbox.uq.oz.au) wrote:
: Does anybody out there know of a mailer that will put in a .sig
: at random ? (if not I suppose I can use tin to do my mailing)
: thanks
A mailer? you mean like a mail reader like elm? I know elm has no
problem with putting sigs at the bottom of letters. I don't know about
mail or mailx. I also know that Pine can also put sigs at the bottom
of letters (change the pinerc (?) and elmrc respectivly.) If your
talking about something else I don't have a clue (I know people are
already saying that bout me ;).
-Harry
.---. .----------- .__ __
/ \ __ / ------ _____ | | _____ _____| | _______
/ / \( `-, ----- \__ \ | | \__ \ / ___/ |/ /\__ \
////// '~ ( --- / __ \| |__/ __ \_\___ \| < / __ \_
//// / // : ; --- (____ /____(____ /____ >__|_ \(____ /
// / / /) / -- \/ \/ \/ \/ \/
/ //..\\ No bird soars too high, if he soars with his own wings
==========UU====UU======================- Harry Marlin -=====================
'//||\\` Ala...@gate.net
''``
Alaska (ala...@gate.net) wrote:
: Hamish Currie (H.C...@mailbox.uq.oz.au) wrote:
: : Does anybody out there know of a mailer that will put in a .sig
: : at random ? (if not I suppose I can use tin to do my mailing)
: : thanks
: A mailer? you mean like a mail reader like elm? I know elm has no
: problem with putting sigs at the bottom of letters. I don't know about
: mail or mailx. I also know that Pine can also put sigs at the bottom
: of letters (change the pinerc (?) and elmrc respectivly.) If your
: talking about something else I don't have a clue (I know people are
: already saying that bout me ;).
Here I go responding to one of my own posts again (<sigh> will I ever
learn to *read* first?). Sorry, I did not see the keyword *random.* For
that ,I have no clue <sigh>. Sorry for answering a question you already
knew.(now if only more people could ask me questions that they already
know the answer to ;)
-Harry
.---. .----------- .__ __
/ \ __ / ------ _____ | | _____ _____| | _______
/ / \( `-, ----- \__ \ | | \__ \ / ___/ |/ /\__ \
////// '~ ( --- / __ \| |__/ __ \_\___ \| < / __ \_
//// / // : ; --- (____ /____(____ /____ >__|_ \(____ /
// / / /) / -- \/ \/ \/ \/ \/
/ //..\\ No bird soars too high, if he soars with his own wings
==========UU====UU======================- Harry Marlin -=====================
'//||\\` Ala...@gate.net
''``
TPot (i92...@redgum.ucnv.edu.au) wrote: > Ok, a while back ('bout a month) I posted a little script I have made > that gets a random sig. Somehow I don't think it got through (we have a > rather bad news feed at times). In case it did and no-one liked it I > won't post it again, but feel free to ask me for it. Ask! :-) -- Ryan Tucker rtu...@worf.infonet.net Des Moines, Iowa rtu...@ins.infonet.net http://www.infonet.net/showcase/rtucker -=- Uhhh, huh huh, you said .sig. Cool.
In article <36a2ra$bj...@sashimi.wwa.com>, ala...@gate.net (Alaska) writes: > All you have to do is post something and tin will randomly select a file > in you signature directory and put it at the end of the post. > > -Harry Okay, what I'm wondering is, what is "TIN"??? - Sam B PSS...@orion.alaska.edu
pss...@orion.alaska.edu wrote:
: In article <36a2ra$bj...@sashimi.wwa.com>, ala...@gate.net (Alaska) writes:
: > All you have to do is post something and tin will randomly select a file
: > in you signature directory and put it at the end of the post.
: >
: > -Harry
: Okay, what I'm wondering is, what is "TIN"???
Sorry. I forgot to mention that. Tin is a newsreader (like rn,trn, and,
ug, nn). It is menu based (i.e. you can use the arrow keys to move up
and down to select your newsgroup and article. I presonally think it is
much superior to all the others. You can do a lot of cool stuff with
it. I am not sure where you can pick up a copy though. If you want, you
can e-mail me, and I'll check it out. Good luck
-Harry
.---. .----------- .__ __
/ \ __ / ------ _____ | | _____ _____| | _______
/ / \( `-, ----- \__ \ | | \__ \ / ___/ |/ /\__ \
////// '~ ( --- / __ \| |__/ __ \_\___ \| < / __ \_
//// / // : ; --- (____ /____(____ /____ >__|_ \(____ /
// / / /) / -- \/ \/ \/ \/ \/
/ //..\\ No bird soars too high, if he soars with his own wings
==========UU====UU======================- Harry Marlin -=====================
'//||\\` Ala...@gate.net
''``
pss...@orion.alaska.edu wrote:
}Okay, what I'm wondering is, what is "TIN"???
The best news reading program available.
I take it that the parties who started this discussion are interested in
doing random signatures such as mine.
[ begin "lesson" ]
-----BEGIN PGP SIGNED MESSAGE-----
Q&A with Dionisio (Origin: July 15, 1994)
This all began with a simple question...
Richard S. Hendershot (rhe...@infinet.com) wrote:
} Let me know how to add those thoughts-of-the-day, whenever you
}find out, eh?
All right, normally I'd tell ya to type 'man tin' and read, but since I'm
still in a good mood from Gwennis, I'll distill the stuff and then tell ya
to 'man tin' and read. :)
tin has two ways of making a signature file for you. Normal - "This
thing'll never change" - and random/semi-random - "part or ALL of this
thing will change".
To make a Normal signature, type 'pico .signature' and type away. (Pop in
a cute quote, give your net address, list hobbies, perhaps include an
ascii picture, etc...) And you'll be all set.
To do a random/semi-random is a smidge more involved.
For a completely random signature, you'll have to make a directory (".Sig"
is what I call mine) and fill it with numbered files. (Ie, "sig.01",
"sig.02", "sig.03", etc...) and tin will pick one at random for your
messages.
Semi-random signatures involve telling tin that you want it to combine a
few things that wont change along with something random. To get the
random part, you do the exact same thing you do to get a totally random
signature. To get the "fixed" part, type 'pico .sigfixed' and type away.
My Signature below is a semi-random creation. The "And the..." (AND the
blank line below it) are my ".sigfixed". What pops up under that is from
the random selections. (Currently, I have a little under 700 for tin to
choose from.)
***IMPORTANT***
Some people out there frown on signatures that are over four lines long.
(The news programs at some sites wont let you have signatures longer than
that, and will truncate your signature.) Consider what you want included
carefully. (Remember, put your phone number down and people MIGHT call
you. And you might not *want* some people to call you. Ditto with
addresses.) You can go over this limit a little, but be warned that long
signatures will eventually get you some nasty "you're wasting bandwith"
mail.
If you absolutely can NOT condense your signature down to under eight
lines, PLEASE put "finger me for more info" in it. (Fingering people is
another subject.)
Now, go do some reading. :) (Ya need to do something else too if you want
the random stuff. <hint>)
-----BEGIN PGP SIGNATURE-----
Version: 2.6.1
iQCVAwUBLn57yx9FS+jQwzcJAQHYRAQAi6Bh9wxiWbn7379QLo3vUuPDITR9wX38
KB9ayi0zqu3ideK+1S0A2roxCcEnkqJmLkHwFf4N/q+0NhndI7jbUJqFGaKwQokI
3ilcr3SO0Ct4dLxkVEHOmdWK6ytpeMyBP7bpgxSrdE3sLJKNoBFv7NrYTUnfY72Q
YbVjoYH/WSY=
=QyY/
-----END PGP SIGNATURE-----
[ End ]
--
And the Thought of the Moment (tm) is...
I refuse to have a battle of wits with an unarmed person.
And if the previos message didn't satisfy... (Again, this applies to the
tin program.)
[ Begin another "lesson" ]
-----BEGIN PGP SIGNED MESSAGE-----
Another Q&A session with Dionisio (Origin: Aug 8, 1994)
Gwennis Mooncat (gwe...@infinet.com) wrote:
}...or is there some way to make different .sigs that i can call up when i
}want them? the other method would always randomize, unless i read it
}wrong.
Yes, there's a way to have signatures designed for individual news groups.
and...
}now, how do you change the line in the header? in case i want it to say
}"gwennis needs help, apply below?"
...this can be done at the same time too! (Should you want a different
header for different groups.)
'cd' to '.tin' and look for a file named attributes. 'pico attributes' and
BE CAREFUL. tin looks at "attributes" when you first start it up. (You'll
see "reading attributes...") Any line starting with "#" is ignored.
REMEMBER that.
Read down through the stuff that is already in "attributes". This is stuff
you CAN do, but don't necessarily NEED to do. When you get to the end of
the "#"'d lines, you can type in whatever you like. AGAIN, BE CAREFUL. As
I said, tin looks at this file. I've done some experimentation, and it'll
ignore some typos and just not do what you wanted. However, I didn't press
things either. Give the thing a second look before you save your
modifications.
Basically, you MUST tell it what newsgroup you want (We'll use this one
for an example), what you want it to do in this group, and how you want it
done.
(Example:
To change the header, we add:
newsgroup=infinet.general
organization="blah, blah, blah")
"organization" is what changes the header. (Note: you do not need the
quotes. Anything after the "=" is automatically included.)
To change the signature files for the various groups, we just use the
proper command and then tell it what file we want to use. (Its pretty
obvious, just look. <g>)
Just be sure those files you're telling tin to look for actually exist. :)
Also, desire to change the header when <f/F>ollowing-up a message? At the
top of the message you're composing after you hit "f" or "F", you'll see:
Subject: kjhfaditysfiughzf,mjbsfitzd gudyh
Newsgroups: sdfds.hguuyi,ytuytuyt.ioxfhg,tutrurty.fdgdf.wrxz
...and a few other things. "Organization: fkgdfuthri" may, or may not,
exist. If it does, just change what follows after it. (Be sure to leave a
space after the ":" or you'll get yelled at and forced back into the
editor. <g>) If "Organization: " doesn't exist, tack it on.
Words of caution/education:
A space MUST follow the ":"
Headers can only be so long. If you see that your header gets truncated,
you've found the length barrier. <G>
You can't have any blank lines seperating the stuff at the top of the
message if you want tin to do what you want. Nor can you put a blank line
at the very top of your message.
(Example:
Subject: hfdhgfdkjghf
Newsgroups: fdhgfh.uioiu.ewr
Organization: fjhgjkhtrf
...is ok.
Subject: fljg.fkjgfdgj
Newsgroups: fdgdfg.yuuy.opiop,reret.yu.sr.ytuuuy
Organization: fgdsgsyy
..isn't ok. You wont get yelled at, but your header wont change. Instead
you'll see "Organization: fgdsgsyy" at the very top of your posted message.)
Please experiment on infinet.test with this. If you discover problems,
<r>eply to me via emial and I'll take a look. (But I'll get grumpy if I
see you've done something I told you NOT to do.)
-----BEGIN PGP SIGNATURE-----
Version: 2.6.1
iQCVAwUBLn57Rx9FS+jQwzcJAQGbMAP/X/j8i/nazanHYz9qCE1+8aNLwz7Da42o
tuuA0h51Q/vdbmGNh/0JQCDlap1GezHd8zgKt8IQqMTDut2oImCs1utQ8YsnJ/zH
qVT2WPE14qqYtvsBx2uBYJGx4r3M4g7fo1MdJea1uuVfQX/AHH8qNV+tgyCYnbZe
hO9LxUxu2kI=
=xr60
-----END PGP SIGNATURE-----
[ End ]
--
And the Thought of the Moment (tm) is...
A UNIX saleslady, Lenore,
Enjoys work, but she likes the beach more.
She found a good way
To combine work and play:
She sells C shells by the seashore.
Alaska (ala...@gate.net) wrote: : Alaska (ala...@gate.net) wrote: : : Hamish Currie (H.C...@mailbox.uq.oz.au) wrote: : : : Does anybody out there know of a mailer that will put in a .sig : : : at random ? : (now if only more people could ask me questions that they already : know the answer to ;) What is the square root of twenty three ?? :) Well I have not found any realy great ideas for this problem, I have had a few solutions, At the moment I am choosing the .sig manually (^R to attach a text file in the pine mailer) I had a script changing the .sig every time I ran pine, however I was sending multiple mail messages from one session of pine, and it was just not good enough. I am going to try having a backgroung process changing the .sig every minute or so, But I will have to see how it goes in terms of slowing down the computer. Thanks to all the people that replied. -Hamish [.sig lost in rm -r accident :( ]
H.C...@mailbox.uq.oz.au (Hamish Currie) writes: >Alaska (ala...@gate.net) wrote: >: Alaska (ala...@gate.net) wrote: >:: Hamish Currie (H.C...@mailbox.uq.oz.au) wrote: >::: Does anybody out there know of a mailer that will put in a .sig >::: at random ? >: (now if only more people could ask me questions that they already >: know the answer to ;) >What is the square root of twenty three ?? :) >Well I have not found any realy great ideas for this problem, I have had a >few solutions, At the moment I am choosing the .sig manually (^R to AARGH! I've posted a script to do this _three_ times now, and it still hasn't appeared here! :-( >attach a text file in the pine mailer) I had a script changing the .sig pine... hmmm, don't know if this Bourne script can be tweaked to work with pine, but it sure works well with nn (and mailx if you use that as a mailer). >one session of pine, and it was just not good enough. I am going to try >having a backgroung process changing the .sig every minute or so, But I >will have to see how it goes in terms of slowing down the computer. There was a c program recently posted to alt.sources that did that sort of this, but this script will randomly pick sigs when you want them. Not so long ago I posted this to the figlet list... This little script here "injects" sigs and "fortune cookies" into your email and usenet posts on a (pseudo) random basis. This is pure Bourne shell script. I've tested this quite extensively, but I CANNOT guarantee that it will work perfectly for you. Read the notes at the end of this script about how to use it and how to set up mail/mailx and nn to enable this. Note that I have only ever used this with these programs... I have no idea how they might work with other email program and news readers like pine, rn, or tin. Be sure to read this script throughly, making alterations where necessary for your system / setup. It should be fairly generic as it is, once you have things set up for yourself. Check also your man pages for nn, mail, mailx and sendmail to make sure they will behave as expected. Experiment by emailing to yourself, and posting in misc.test or alt.test. It works for me. Your mileage may vary. If anyone picks up any bugs or has suggestions for improvements, then please don't hesitate to email me. injector is shar'ed below. Oh, one last thing. I've included another little script that I use to centre lines. I use it in my injector script. I'll put this one here plain... if anyone can suggest how I can improve on this one, I'm all ears! (It uses nawk, but surely there's a better way to do it:) This script follows the shar script. Enjoy! #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: injector # Wrapped by sctnugen@kraken on Wed Sep 28 15:03:17 1994 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'injector' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'injector'\" else echo shar: Extracting \"'injector'\" \(5478 characters\) sed "s/^X//" >'injector' <<'END_OF_FILE' X#!/bin/sh X# X#!/usr/bin/sh here on my Solaris 2.3 / SunOS 5.3 X# X############ X# injector # Version 1.0 X############ X# X###################################################################### X# Email and Usenet news random signature and fortune cookie injector # X###################################################################### X# X# Tony Nugent September 1994 X# T.N...@sct.gu.edu.au tnu...@gucis.cit.gu.edu.au X# X# SEE USAGE NOTES AT THE END OF THIS SCRIPT X# X################################################################ X# Get rid of the tmp files if an error occurs X############################################# Xcleanup() X{ X rm -f $tmpmsg $tmpsig X exit 1 X} Xtrap cleanup 1 2 3 X# X# Set up the files and directories to use X######################################### X# Xsigdir="$HOME/.sigs" Xsigfiles=".sig." Xtmpdir="/tmp" Xmailhead="$sigdir/.head" Xmailtail="$sigdir/.tail" Xtmpmsg="$tmpdir/injector.$$" Xtmpsig="$tmpdir/injector.sig.$$" X# X# Set programs to use X##################### X# Xmailer="/usr/lib/sendmail" Xif [ X$1 = X-N ]; then X mailer="/usr/local/bin/inews" X shift Xfi X# X# Get random fortune cookie X# (insert your fortune cookie program here) X########################################### X# X fortune="echo insert witty saying here" X# fortune="$HOME/bin/goofey -f 3" X# X# Choose a random .sig file X########################### X# X# Find the number of .sig.* files Xnumsigs=`ls ${sigdir}/${sigfiles}* | wc -w` X# Get a pseudo-random number (based on the current process number) Xrseed=$$ X# Make this number 0 -> $numsigs Xrnd=`expr $rseed % $numsigs` X# Set the .sig file name Xmailsig="${sigdir}/${sigfiles}${rnd}" X# X################################################################ X# Now down to work! X################### X# X# Get the message from stdin and save it X# Xcat - > $tmpmsg X# X# Check for noquote in the last three lines X# Xif ( [ `tail -3 $tmpmsg | grep noquote | wc -l` -eq 1 ]); then X # Don't continue processing if it's there X # But get rid of the line with noquote in it X numl=`wc -l < $tmpmsg` X topl=`expr $numl - 3` X head -$topl $tmpmsg > $tmpsig X tail -3 $tmpmsg | grep -v noquote >> $tmpsig X cat $tmpsig | $mailer "$@" X # Xelse X # X # add intro X if [ -r $mailhead ] ; then X cat $mailhead >> $tmpmsg X fi X # X # add signature X cat $mailsig > $tmpsig X # X # add fortune cookie (centred) for email only X if [ `basename $mailer` = sendmail ]; then X if [ "X$fortune" != X ]; then X $fortune | centre >> $tmpsig X # add tail line X if [ -r $mailtail ]; then X cat $mailtail >> $tmpsig X fi X fi X fi X X # send it off X cat $tmpmsg $tmpsig | $mailer "$@" X X # let's have a peek at the sig and the cookie... X cat $tmpsig > /dev/tty Xfi Xrm $tmpsig Xrm $tmpmsg Xexit 0 X X##################################################################### X# Email and Usenet news random signature and fortune cookie injector. X##################################################################### X# Only tested with nn and mail/mailx. X# X# Tony Nugent September 1994 X# T.N...@sct.gu.edu.au tnu...@gucis.cit.gu.edu.au X# Based on a set of shell scripts originally by X# Dave Conners, dco...@gucis.cit.gu.edu.au X# (But hacked almost beyond recognition now! :-) X# X################################################################ X# X# WARNING! USE AT YOUR OWN RISK !!! X# X# You are well advised to test this script before using it by X# emailing to yourself and posting to misc.test or alt.test X# (with "ignore no reply" as the subject, unless you like lots X# of dead email :-). X# X# Read the man pages for nn, mail, mailx and sendmail X# (and inews if it's there) before using this script. X# X################################################################ X# X# SETUP AND USAGE NOTES X# X# This file works by taking a message being piped to it from X# mailx and nn, WITH command-line parameters. X# X############################### X# X# To use this script with mail or mailx, point the X# sendmail variable in the ~/.mailrc file to it: X# X# sendmail=/<fullpath>/injector X# X############################### X# X# To use with nn, add the following to the ~/.nn/init file X# to point the inews and mailer variables to it: X# X# set inews /<fullpath>/injector -N -h X# set mailer /<fullpath>/injector -t X# set append-signature-mail false X# set append-signature-post false X# X# The inews and mailer parameters may vary with your system's X# setup, but to allow this script identify the _source_ of the X# calling program, set the -N parameter with inews. X# X# If you have ~/.signature or ~/.Signature files, then delete them. X# X############################### X# X# Create a directory that contains all your .sig files. X# I have used ~/.sigs here, but edit for your own tastes. X# X# Create a series of sequentially numbered .sig.* files, start at .sig.0 X# I have used .sig.0 .sig.1 .sig.2 etc; again edit as desired. X# You can have as many as you like, but restrict them to only a few lines. X# X# Create two files called .head and .tail (in the ~/.sigs directory) X# .head contains your usual "signoff" (eg, "Cheers \nTony") X# .tail contains anything you want to finish off your sig, like X# a fancy one-liner or whatever. X# X# TO PREVENT THE INJECTION OF ANY .SIG: X# That is, to tell this script not to do its usual thing: X# - just add "noquote" to the end of your message! X# - be warned that any line of your message with "noquote" X# in the last few lines will be deleted from the message. X# X############################### END_OF_FILE if test 5478 -ne `wc -c <'injector'`; then echo shar: \"'injector'\" unpacked with wrong size! fi chmod +x 'injector' # end of 'injector' fi echo shar: End of shell archive. exit 0 ====8<----cut-for-centre----------------------------------- #!/bin/sh # #!/usr/bin/sh here on my Solaris 2.3 / SunOS 5.3 # # centre all input text on an 80-column line cat - | nawk '{ if ( length < 80 ) { \ le = ( 80-length ) / 2 ; \ for ( i=1 ; i<=le ; i++ ) { \ printf(" ") } ; \ } print $0 \ }' ====8<----cut-for-centre----------------------------------- Cheers Tony __ __ __/\_\ . Tony Nugent /_/\__ __/\_\/_/ _--_|\ Griffith University \_\/_/\__ /\_\/_/\_\ / *\ Brisbane, Queensland, Australia /_/\_\/_/\ \/_/\_\/_/ \_.--._/ tnu...@gucis.cit.gu.edu.au \_\/_/\_\/ \/_/\_\ v T.N...@sct.gu.edu.au /_/\_\/ \/_/ \_\/
Related ASCII art in the Gallery
Explore these categories from our collection of 11,000+ artworks:
_ _ (o)(o)--. \../ ( )hjw m\/m--m'`--.
_ _
/` \/ `\_ _
\ /` \/ `\
'. .\ /
\/ '. .'
\/jgs __ . . __ (o.\ \/ /.o) \__\/\/__/ /O /==\ O\ (;O/ \/ \O;)
_______ |.-----.| || jgs || ||_ _|| `--)-(--` __[=== o]___ |:::::::::::|\ `-=========-`()
,sSSs ,SSSS_/ ,_ sS/`))\// sS//|_(_/ _, SS\\\ `""-.-'` / sSS` jgs-==-'`'-._\
___________ | _______ | | | | | | | | | | | | | | |_______| | |___________|
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
rec.arts.ascii
in 1994 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.