Thread View: news.software.nn
22 messages
22 total messages
Started by Mike Gleason
Fri, 30 Aug 1991 02:10
Deluxe Sigs in NN
Author: Mike Gleason
Date: Fri, 30 Aug 1991 02:10
Date: Fri, 30 Aug 1991 02:10
14 lines
1362 bytes
1362 bytes
Here's another message Kim can clip 'n' save for later. I'd like to have different signatures for different groups. It would be nice if I could specify a signature file along with the name of the save file in the 'init.' The ELM mailer allows you specify a localsignature and a remotesignature; I could settle for that if I had to :-) Even better, if the signature file I specify is a directory, perhaps nn could pick a sig at random from that directory. -- ______________________________________________________________________________ mike gleason mgleason@cse.unl.edu NCEMRSoft, baby! -- ______________________________________________________________________________ mike gleason mgleason@cse.unl.edu NCEMRSoft, baby!
Re: Deluxe Sigs in NN
Author: Cindy Tittle Moore
Date: Fri, 30 Aug 1991 04:34
Date: Fri, 30 Aug 1991 04:34
20 lines
1502 bytes
1502 bytes
In <1991Aug30.021038.1235@unlinfo.unl.edu> mgleason@cse.unl.edu (Mike Gleason) writes: >Here's another message Kim can clip 'n' save for later. I'd like to have >different signatures for different groups. It would be nice if I could >specify a signature file along with the name of the save file in the 'init.' >The ELM mailer allows you specify a localsignature and a remotesignature; >I could settle for that if I had to :-) Even better, if the signature file >I specify is a directory, perhaps nn could pick a sig at random from that >directory. YES YES YES! I have tried, unsucessfully, for some time to do this. I would love to see this added to nn. --Cindy -- Cindy Tittle Moore Internet: tittle@ics.uci.edu | BITNET: cltittle@uci.bitnet UUCP: ...!ucbvax!ucivax!tittle | Usnail: PO Box 4188, Irvine CA, 92716
Re: Deluxe Sigs in NN
Author: "Musical surprise laughter" Neil...
Date: Fri, 30 Aug 1991 12:55
Date: Fri, 30 Aug 1991 12:55
15 lines
1458 bytes
1458 bytes
tittle@zola.ics.uci.edu (Cindy Tittle Moore) writes: >In <1991Aug30.021038.1235@unlinfo.unl.edu> mgleason@cse.unl.edu (Mike Gleason) writes: >>Here's another message Kim can clip 'n' save for later. I'd like to have >>different signatures for different groups. It would be nice if I could >>specify a signature file along with the name of the save file in the 'init.' >YES YES YES! I have tried, unsucessfully, for some time to do this. >I would love to see this added to nn. I would also like to see this. rn can do it, but nn can't. nrp@csres.cs.reading.ac.uk \-------------------------------------------------- ----------------------------\ Wenn ist das Nunstuck git und Slotermeyer? Ja! ... Beiherhund das Oder dir Flipperwaldt gersput. -- "Killer Joke"
Re: Deluxe Sigs in NN
Author: David F. Skoll
Date: Fri, 30 Aug 1991 13:53
Date: Fri, 30 Aug 1991 13:53
76 lines
3081 bytes
3081 bytes
In <1991Aug30.021038.1235@unlinfo.unl.edu> mgleason@cse.unl.edu (Mike Gleason)
writes:
>Here's another message Kim can clip 'n' save for later. I'd like to have
>different signatures for different groups. It would be nice if I could
>specify a signature file along with the name of the save file in the 'init.'
>The ELM mailer allows you specify a localsignature and a remotesignature;
>I could settle for that if I had to :-) Even better, if the signature file
>I specify is a directory, perhaps nn could pick a sig at random from that
>directory.
I've modified the "aux" program included with nn to run my 'thought' program
and generate a random signature. (See the bottom of this article.) You can
set the 'news-script' variable to run the modified "aux" program. Below is
my patch for "aux"; play with it as you wish.
-------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
*** /usr/local/lib/nn/aux Thu Oct 4 15:21:23 1990
--- aux Thu Aug 29 16:09:35 1991
***************
*** 167,173 ****
# call editor to enter at line $ED_LINE of work file
case `basename "${EDITOR-vi}"` in
! vi|emacs|emacsclient )
# Berkeley vi display editor
# GNU emacs disply editor
${EDITOR-vi} +${ED_LINE} $WORK
--- 167,173 ----
# call editor to enter at line $ED_LINE of work file
case `basename "${EDITOR-vi}"` in
! vi|emacs*|emacsclient )
# Berkeley vi display editor
# GNU emacs disply editor
${EDITOR-vi} +${ED_LINE} $WORK
***************
*** 285,290 ****
--- 285,294 ----
fi
done
+ if [ ${APPEND_SIG} = "true" -a -f $HOME/.nn/newsig.rc ] ; then
+ thought $HOME/.nn/newsig.rc > $HOME/.signature
+ fi
+
if [ ${APPEND_SIG} = "true" -a -f $HOME/.signature ] ; then
if ${QUERY_SIG} ; then
${AWK} 'END{printf "Append .signature? (y) "}' < /dev/null
***************
*** 294,301 ****
fi
case $ans in
''|y*|Y*)
! echo "-- " >> $WORK
cat $HOME/.signature >> $WORK
;;
esac
fi
--- 298,308 ----
fi
case $ans in
''|y*|Y*)
! echo "--" >> $WORK
! echo "David F. Skoll" >> $WORK
! echo "" >> $WORK
cat $HOME/.signature >> $WORK
+ rm -f $HOME/.signature
;;
esac
fi
-------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
--
David F. Skoll
Why is Mandy so hypnotic? Because Joan helps her lunatic log.
Re: Deluxe Sigs in NN
Author: Cindy Tittle Moore
Date: Fri, 30 Aug 1991 18:52
Date: Fri, 30 Aug 1991 18:52
29 lines
1983 bytes
1983 bytes
In <dfs.683560439@reg> dfs@doe.carleton.ca (David F. Skoll) writes: >In <1991Aug30.021038.1235@unlinfo.unl.edu> mgleason@cse.unl.edu (Mike Gleason) >writes: >>Here's another message Kim can clip 'n' save for later. I'd like to have >>different signatures for different groups. It would be nice if I could >>specify a signature file along with the name of the save file in the 'init.' >>The ELM mailer allows you specify a localsignature and a remotesignature; >>I could settle for that if I had to :-) Even better, if the signature file >>I specify is a directory, perhaps nn could pick a sig at random from that >>directory. >I've modified the "aux" program included with nn to run my 'thought' program >and generate a random signature. (See the bottom of this article.) You can >set the 'news-script' variable to run the modified "aux" program. Below is >my patch for "aux"; play with it as you wish. Randomizing is easy; you don't even have to patch it through nn. Attaching specific sigs to specific groups is another question entirely... --Cindy -- Cindy Tittle Moore Internet: tittle@ics.uci.edu | BITNET: cltittle@uci.bitnet UUCP: ...!ucbvax!ucivax!tittle | Usnail: PO Box 4188, Irvine CA, 92716
Re: Deluxe Sigs in NN
Author: Michael Rawdon
Date: Sat, 31 Aug 1991 04:54
Date: Sat, 31 Aug 1991 04:54
44 lines
3181 bytes
3181 bytes
What I'd like to see is two new variables that do the following: associated-newsgroup-signatures would allow a user to create files in his .nn directory called .signature.[newsgroup] Whenever someone posts an article to a newsgroup, the signature in the file .signature.[newsgroup] would be used. If no such file exists for that group, the ~/.signature file would be used instead. If neither file exists, no signature would be appended (which is how it works now). A protocol should perhaps be worked out in the case of crossposting. (Maybe a separate variable to indicate which file has precedence in the case of crossposting.) random-signatures would allow the user's .signature file to actually be a database of signatures (the db being scanned whenever the user enters nn, much the same way that the killfile is compiled, if I understand correctly how that works). Whenever someone posts an article, a random signature would be plucked from the .signature file and appended to the article. If this variable is unset and the .signature file is set up as a database, only the first signature would be used. Leaving both variables unset would give the user the capabilites that nn currently has - i.e., only the .signature file is used, and only the first signature from that file is ever used. Setting both variables would allow the .nn/.signature.[newsgroup] files to be used as databases for random signatures for each newsgroup. The ~/.signature file could also be a database, if desired. This option may be rather time-consuming when nn is first started up, as all the files would have to be scanned to see if they're databases. However, to save time, nn could just scan for those .nn/.signature.[newsgroup] files appropriate for groups listed in the .newsrc file. Actually, now that I think about it, this could be rather complex, depending on the approach taken to the implementation. However, I think that this sceme would be incredibly powerful and should provide most, if not all, of the capabilities that people seem to want. What do people think? -- Michael Rawdon rawdon@rex.cs.tulane.edu (Now in Madison, Wisconsin. Stay tuned for new e-mail address...) 7/28/87: A careless speech writer includes the word "paradigm" in President Reagan's speech on superconductivity. Yes, he pronounces it "paradijum." - from _The_Clothes_Have_No_Emperor_ by Paul Slansky
Re: Deluxe Sigs in NN
Author: Cindy Tittle Moore
Date: Sat, 31 Aug 1991 17:56
Date: Sat, 31 Aug 1991 17:56
49 lines
2645 bytes
2645 bytes
In <8963@cs.tulane.edu> rawdon@cs.tulane.edu (Michael Rawdon) writes: >What I'd like to see is two new variables that do the following: >associated-newsgroup-signatures would allow a user to create files in >his .nn directory called .signature.[newsgroup] [...] >random-signatures would allow the user's .signature file to actually be >a database of signatures (the db being scanned whenever the user enters >nn, much the same way that the killfile is compiled, if I understand >correctly how that works). [...] >Actually, now that I think about it, this could be rather complex, >depending on the approach taken to the implementation. However, I think >that this sceme would be incredibly powerful and should provide most, if >not all, of the capabilities that people seem to want. What do people >think? I think that the randomizing can be left out. I do that now; what I have is a shell script (attached, for anyone who might want to make use of it) that picks out a sig at random. I have an alias for nn that calls this script before starting nn up. This could be easily expanded to randomize the .signature.[newsgroup] files, too. This would reduce the complexity of the proposed changes. The .signature.[newsgroup] would be GREAT -- I miss this capability quite a bit from rn/gnews... --Cindy #! /usr/public/tcsh -f # or use /bin/csh -f if that's your shell # setquote nohup set newsdir = '~/News' set quotedir = '~/News/quotes' @ quotenum = `/bin/date '+%S'` @ quotenum = $quotenum % 20 + 1 # where 20 is the total # of files you have if ($quotenum < 10) then set curquote = quote0$quotenum else set curquote = quote$quotenum endif cp $quotedir/$curquote $newsdir/.signature -- Cindy Tittle Moore Internet: tittle@ics.uci.edu | BITNET: cltittle@uci.bitnet UUCP: ...!ucbvax!ucivax!tittle | Usnail: PO Box 4188, Irvine CA, 92716
Re: Deluxe Sigs in NN
Author: Michael Rawdon
Date: Sat, 31 Aug 1991 18:20
Date: Sat, 31 Aug 1991 18:20
27 lines
2019 bytes
2019 bytes
In <28BFD864.10903@ics.uci.edu> tittle@alexandre-dumas.ics.uci.edu (Cindy Tittle Moore) writes: >I think that the randomizing can be left out. I do that now; what I >have is a shell script (attached, for anyone who might want to make >use of it) that picks out a sig at random. I have an alias for nn >that calls this script before starting nn up. This could be easily >expanded to randomize the .signature.[newsgroup] files, too. This >would reduce the complexity of the proposed changes. The >.signature.[newsgroup] would be GREAT -- I miss this capability quite >a bit from rn/gnews... [An exceprt from her script:] >@ quotenum = $quotenum % 20 + 1 # where 20 is the total # of files you have I'd like to see a randomizing function where you don't have to make some modification to the function whenever you add a new signature to the database. I.e., you just stick a new sig in and the program does everything else for you. Having to go make modifications to other files seems (and actually is, IMHO) awkward. (Or am I misreading how your shell works?) -- Michael Rawdon rawdon@cs.wisc.edu Recent grad of Tulane's CS Department, now at U Wisconsin - Madison. Stephen Dennison's life is a sine wave, and we're all trying to get the amplitude up.
Re: Deluxe Sigs in NN
Author: Vomit Boy
Date: Sat, 31 Aug 1991 18:55
Date: Sat, 31 Aug 1991 18:55
13 lines
1391 bytes
1391 bytes
A really lazy way to do all this is to find a canned program that will
generate a random saying when run and just have it write a new .signature
file.
For example, I use a silly program called 'yow' which generates quotes from
Zippy the Pinhead to simply overwrite the .sig file whenever I login. Replacing
the data file with Murphy's laws, Irish Drinking Songs, Post Office Zip Codes,
etc. ... is trivial.
--
=============================================================
| Without fools, wisdom is unnecessary |
=============================================================
Re: Deluxe Sigs in NN
Author: Cindy Tittle Moore
Date: Sat, 31 Aug 1991 19:03
Date: Sat, 31 Aug 1991 19:03
29 lines
1973 bytes
1973 bytes
In <8968@cs.tulane.edu> rawdon@cs.tulane.edu (Michael Rawdon) writes: >[An exceprt from her script:] >>@ quotenum = $quotenum % 20 + 1 # where 20 is the total # of files you have >I'd like to see a randomizing function where you don't have to make some >modification to the function whenever you add a new signature to the database. >I.e., you just stick a new sig in and the program does everything else for >you. Having to go make modifications to other files seems (and actually >is, IMHO) awkward. >(Or am I misreading how your shell works?) No, you're not. If I add any new files (or take away!), I have to go and modify this number. I imagine, though, that this could be dealt with. For example, the number could be calculated by doing a for each file (I forget the exact syntax) and incrementing a counter which is then used for the modulus. Only reason I haven't put it in is sheer laziness; I suppose I could hack something up if you're interested (or anyone else is)... --Cindy -- Cindy Tittle Moore Internet: tittle@ics.uci.edu | BITNET: cltittle@uci.bitnet UUCP: ...!ucbvax!ucivax!tittle | Usnail: PO Box 4188, Irvine CA, 92716
Re: Deluxe Sigs in NN
Author: J.B. Nicholson
Date: Sat, 31 Aug 1991 20:38
Date: Sat, 31 Aug 1991 20:38
30 lines
2039 bytes
2039 bytes
>>>Here's another message Kim can clip 'n' save for later. I'd like to have
>>>different signatures for different groups. It would be nice if I could
>>>specify a signature file along with the name of the save file in the 'init.'
Why can't this be done with the "on <groupname>" structure in the init file?
You could say something to the effect of:
on news.software.nn
set signature ~/.signatures/news.software.nn
end
(the exactness of the syntax might be wrong but you get the jist of it).
This way you can reset anything you want based on the groupname. You could
even do something like (to be snazzy):
{get the groupname to be in some variable up here}
on <groupname>
{some way of saying "if ~/.signatures/<groupnamevariable> exists then"}
set signature ~/.signatures/<groupnamevariable>
{some way of saying "else set signature ~/.signature"}
endif
end
That last one could make it so that if you want a special sig for a certain group,
just make the sig with the filename of the group and drop it in the ~/.signatures
subdir, otherwise just use my plain old ~/.signature. I don't know if IFs like
that can be done in the latest version of nn, but it's an idea.
--
-- Jeff
-- jeffo@uiuc.edu
Re: Deluxe Sigs in NN
Author: Mike Gleason
Date: Sat, 31 Aug 1991 20:59
Date: Sat, 31 Aug 1991 20:59
31 lines
2353 bytes
2353 bytes
rawdon@cs.tulane.edu (Michael Rawdon) writes: >In <28BFD864.10903@ics.uci.edu> tittle@alexandre-dumas.ics.uci.edu (Cindy Tittle Moore) writes: >[An exceprt from her script:] >>@ quotenum = $quotenum % 20 + 1 # where 20 is the total # of files you have >I'd like to see a randomizing function where you don't have to make some >modification to the function whenever you add a new signature to the database. >I.e., you just stick a new sig in and the program does everything else for >you. Having to go make modifications to other files seems (and actually >is, IMHO) awkward. Here's an interim idea which I or someone else could try. I _think_ nn provides a variable to set the path of inews. Perhaps one could write a C program to preprocess the article before pumping output to inews. Like you could wait look for a Newsgroups: line and then look for the appopriate sig to use (and randomize), copy the sig to ~/.signature, then pipe the whole article to inews. It would be a kludge, and I still think nn should have variables like Michael Rawdon suggested, but it could work; plus you could choose a new sig each time you post an article. I am using a little hack similar to Cindy Tittle's, where the sig is picked one time before running nn. -- ______________________________________________________________________________ mike gleason mgleason@cse.unl.edu NCEMRSoft, baby! -- ______________________________________________________________________________ mike gleason mgleason@cse.unl.edu NCEMRSoft, baby!
Re: Deluxe Sigs in NN
Author: "Midget neglect" Neilski
Date: Mon, 02 Sep 1991 09:22
Date: Mon, 02 Sep 1991 09:22
119 lines
4241 bytes
4241 bytes
rawdon@cs.tulane.edu (Michael Rawdon) writes:
>I'd like to see a randomizing function where you don't have to make some
>modification to the function whenever you add a new signature to the database.
>I.e., you just stick a new sig in and the program does everything else for
>you. Having to go make modifications to other files seems (and actually
>is, IMHO) awkward.
Here's a program written in perl which does this. I've been using it for a
few months now. The template is in the first part of the file, the quotes
are at the end, separated by %% on a separate line (a la cookie).
As it stands, it echoes standard input until EOF so mail can do ~|sig.
Options:
sig -s - don't read standard input
sig -n num - use signature number num (starting at 0)
------------------------------ cut here --------------------------------
#!/gnu/bin/perl
# @(#) sig - generate a random signature
#
# Usage: sig [-s] [-n num]
# where -s means don't read stdin before printing sig
# -n means print signature num
#
# In mail, at the end of a message do ~|sig (at the start of a new line)
# to put a random signature at the end of the mail.
# In .login, you might like to put
# sig -s >! ~/.signature
#
# Look in the code for signature template bits.
# Quotes live at the end of this file.
$sigs = 0;
$DATA_pos = tell(DATA);
while (<DATA>) {
if (/^%%$/) {
$sigs++;
}
}
sub usage {
local($numsigs);
$numsigs = $sigs - 1;
"Usage: $0 [-s] [-n num] [file ...]\nwhere 0 <= num <= $numsigs\n";
}
sub min { $_[0] < $_[1] ? $_[0] : $_[1] ; }
sub max { $_[0] > $_[1] ? $_[0] : $_[1] ; }
require "newgetopt.pl";
do NGetOpt("s", "n=i") || die &usage;
if (! $opt_s) {
while (<>) {
print;
}
shift;
}
if (!defined $opt_n) {
srand;
$num = int (rand $sigs);
} else {
$num = &min($sigs - 1, &max(0, $opt_n));
}
####################
# First part of signature comes between this print and the EOS
####################
print <<EOS;
nrp@csres.cs.reading.ac.uk \\--------------------------------------------------
EOS
print "----------------------------\\ "; # I don't want a newline here
# but you may want to get rid of it
# Print the chosen quote
seek(DATA, $DATA_pos, 0);
for ($qnum = 0; $qnum <= $num ; ) {
if (<DATA> =~ /^%%$/) {
$qnum++;
}
}
while (<DATA>) {
last if /^%%$/;
print;
}
####################
# End part of signature comes between this print and the EOS
####################
print <<EOS;
EOS
####################
# Quotes start on the line after the __END__ token. Separate each quote from
# the next by two % signs on a line on their own - no leading or trailing
# whitespace.
####################
__END__
Due to a bug, this quote should
never occur in one of my .sigs. Please mail me if it does.
%%
"Your mother was a hamster, and your father smelt of elderberries!"
%%
"I'm sorry to interrupt, but my tooth's
hurting, just about here." "Get off." "Sorry."
%%
Wenn ist das Nunstuck git und Slotermeyer?
Ja! ... Beiherhund das Oder dir Flipperwaldt gersput. -- "Killer Joke"
------------------------------ cut here --------------------------------
nrp@csres.cs.reading.ac.uk \--------------------------------------------------
----------------------------\ Wenn ist das Nunstuck git und Slotermeyer?
Ja! ... Beiherhund das Oder dir Flipperwaldt gersput. -- "Killer Joke"
Re: Deluxe Sigs in NN
Author: Bill Wohler
Date: Mon, 02 Sep 1991 15:45
Date: Mon, 02 Sep 1991 15:45
15 lines
1230 bytes
1230 bytes
tittle@alexandre-dumas.ics.uci.edu (Cindy Tittle Moore) writes:
>Randomizing is easy; you don't even have to patch it through nn.
>Attaching specific sigs to specific groups is another question
>entirely...
what he meant is that including the appropriate .signature file was
left as an exercise to the reader. the clue is in using a modified
aux script. two more clues: there is a variable in the script called
${GROUP} and a section to append the signature to the message.
--
--bw
-----
Bill Wohler <wohler@sap-ag.de> <sapwdf!wohler>
Heidelberg Red Barons Ultimate Frisbee Team
Re: Deluxe Sigs in NN
Author: Bill Wohler
Date: Mon, 02 Sep 1991 16:13
Date: Mon, 02 Sep 1991 16:13
14 lines
1044 bytes
1044 bytes
rawdon@cs.tulane.edu (Michael Rawdon) writes: >What do people think? the random feature is too specific. better to have a signature-program variable that uses the output of a program to use as the signature. my vote for these signature things would be no, by the way. -- --bw ----- Bill Wohler <wohler@sap-ag.de> <sapwdf!wohler> Heidelberg Red Barons Ultimate Frisbee Team
Re: Deluxe Sigs in NN
Author: Michael Rawdon
Date: Mon, 02 Sep 1991 17:25
Date: Mon, 02 Sep 1991 17:25
24 lines
1786 bytes
1786 bytes
In <3056@sapwdf.UUCP> wohler@sapwdf.UUCP (Bill Wohler) writes: >rawdon@cs.tulane.edu (Michael Rawdon) writes: >>What do people think? > the random feature is too specific. better to have a > signature-program variable that uses the output of a program to use > as the signature. As long as the nn distribution came with the appropriate programs, that would be fine. (I actually don't see why nn couldn't have BOTH...) > my vote for these signature things would be no, by the way. "No" in what sense? If you don't want to use the variables, you can always leave them unset. What deleterious effects could providing the option of using the variables (and of course, the option of *not* using them) possibly have? -- Michael Rawdon rawdon@cs.wisc.edu Recent grad of Tulane's CS Department, now at U Wisconsin - Madison. "...I guess I'd rather have mediocre Star Trek than none at all." - A friend, about the TNG episode "Legacy"
Re: Deluxe Sigs in NN
Author: J.P.M. van der Jagt/50000
Date: Tue, 03 Sep 1991 11:46
Date: Tue, 03 Sep 1991 11:46
25 lines
2300 bytes
2300 bytes
mgleason@cse.unl.edu (Mike Gleason) writes: =Here's an interim idea which I or someone else could try. I _think_ nn =provides a variable to set the path of inews. Perhaps one could write a C =program to preprocess the article before pumping output to inews. Like you =could wait look for a Newsgroups: line and then look for the appopriate sig to =use (and randomize), copy the sig to ~/.signature, then pipe the whole article =to inews. =It would be a kludge, and I still think nn should have variables like Michael =Rawdon suggested, but it could work; plus you could choose a new sig each time =you post an article. I am using a little hack similar to Cindy Tittle's, where =the sig is picked one time before running nn. =-- =______________________________________________________________________________ =mike gleason mgleason@cse.unl.edu NCEMRSoft, baby! =-- =______________________________________________________________________________ =mike gleason mgleason@cse.unl.edu NCEMRSoft, baby! Picked up one time and appended two times :-) Seen that before... -- [] J.P.M. van der Jagt [] Systems manager [] Delft University of Technology [] [] Email: jeanpaul@duteca.et.tudelft.nl [] Phone: 31-15-781366 [] e m p t y [] [] - He sells C-shells by the seashore - Lauren Bacall - Key Largo - 1948 - []
Re: Deluxe Sigs in NN
Author: David F. Skoll
Date: Tue, 03 Sep 1991 15:49
Date: Tue, 03 Sep 1991 15:49
17 lines
1218 bytes
1218 bytes
In <28BE93E1.5658@ics.uci.edu> tittle@alexandre-dumas.ics.uci.edu (Cindy Tittle Moore) writes: >Randomizing is easy; you don't even have to patch it through nn. >Attaching specific sigs to specific groups is another question >entirely... Right. But in tha "aux" script, you have complete access to the newly-created article. You could write an awk program to pick out the "Newsgroups:" line and select the appropriate signature. It would be tedious, but is doable. -- David F. Skoll Sandra likes your harried lip, because it caresses his dissonant jungle.
Re: Deluxe Sigs in NN
Author: Cindy Tittle Moore
Date: Tue, 03 Sep 1991 18:43
Date: Tue, 03 Sep 1991 18:43
27 lines
1758 bytes
1758 bytes
In <dfs.683912951@lore> dfs@doe.carleton.ca (David F. Skoll) writes: >In <28BE93E1.5658@ics.uci.edu> tittle@alexandre-dumas.ics.uci.edu >(Cindy Tittle Moore) writes: >>Randomizing is easy; you don't even have to patch it through nn. >>Attaching specific sigs to specific groups is another question >>entirely... >Right. But in tha "aux" script, you have complete access to the >newly-created article. You could write an awk program to pick out the >"Newsgroups:" line and select the appropriate signature. It would be >tedious, but is doable. Yup, I finally did just that, though I don't think its a great solution (I would prefer to see Rawdon's ideas implemented). You don't even have to search the "newsgroup" line; the variable $GROUP is there for you to do a case statement on. At least in my copy of aux. --Cindy -- Cindy Tittle Moore Internet: tittle@ics.uci.edu | BITNET: cltittle@uci.bitnet UUCP: ...!ucbvax!ucivax!tittle | Usnail: PO Box 4188, Irvine CA, 92716
Re: Deluxe Sigs in NN
Author: Gerben 'P' Vos
Date: Wed, 04 Sep 1991 19:22
Date: Wed, 04 Sep 1991 19:22
18 lines
1566 bytes
1566 bytes
tittle@alexandre-dumas.ics.uci.edu (Cindy Tittle Moore) writes: > You >don't even have to search the "newsgroup" line; the variable $GROUP is >there for you to do a case statement on. At least in my copy of aux. Is that always the case? The aux file itself documents that it $GROUP is only set when cancelling. What does $GROUP contain when an article is being posted to multiple groups, or being posted while reading a merged group within nn? Anyway, you can't get it to work correctly when the Newsgroups: line is changed in the editor, when using this method. . . . . . . . . . . . . . . . . . . . . . . . . . . . G e r b e n V o s <>< Aconet: 8500/104!Gerben Vos Internet: gpvos@cs.vu.nl The nice thing about standards is there are so many to choose from, and if there is none of your liking, you can just go and make one yourself! -- A. Tanenbaum
Re: Deluxe Sigs in NN
Author: Rob Lemley
Date: Wed, 04 Sep 1991 23:01
Date: Wed, 04 Sep 1991 23:01
44 lines
2525 bytes
2525 bytes
In <8968@cs.tulane.edu> rawdon@cs.tulane.edu (Michael Rawdon) writes:
>In <28BFD864.10903@ics.uci.edu> tittle@alexandre-dumas.ics.uci.edu (Cindy Tittle Moore) writes:
>[An exceprt from her script:]
>>@ quotenum = $quotenum % 20 + 1 # where 20 is the total # of files you have
>I'd like to see a randomizing function where you don't have to make some
>modification to the function whenever you add a new signature to the database.
>I.e., you just stick a new sig in and the program does everything else for
>you. Having to go make modifications to other files seems (and actually
>is, IMHO) awkward.
I'm a little rusty on csh (don't know tcsh) but ...
Try replacing the above line with these two lines:
@ numquotes = `/bin/ls $quotedir | wc -l`
@ quotenum = $quotenum % $numquotes + 1
of course, if you get more than one hundred quotes the program has to
be changed. You could get dozens of answers to this in comp.unix.shell
(but you might get flamed for writing scripts in csh :-).
How about a little sh for this on. This script just plucks
a file at random from your quote directory, doesn't care
what the filenames are. I've taken some extra info from date
to come up with a larger random number.
: setquote
# sh/ksh version
# assumes system V style date command w/formatting for SSMMHHdayofyear
newsdir=$HOME/News
quotedir=$HOME/News/quotes
quotenum=`/bin/date '+%S%M%H%j'`
numquotes=`/bin/ls $quotedir | wc -l`
quotenum=`awk "BEGIN { print $quotenum % $numquotes + 1; exit }"`
curquote=`/bin/ls $quotedir | sed -n -e "${quotenum} p" -e "${quotenum} q"`
cp $quotedir/$curquote $newsdir/.signature
Rob Lemley
---
"Searchlight casting, for faults in the clouds of delusion"
(Onward through the fog!)
Re: Deluxe Sigs in NN
Author: Cindy Tittle Moore
Date: Thu, 05 Sep 1991 20:36
Date: Thu, 05 Sep 1991 20:36
25 lines
1649 bytes
1649 bytes
In <8968@cs.tulane.edu> rawdon@cs.tulane.edu (Michael Rawdon) writes: >[An exceprt from her script:] >>@ quotenum = $quotenum % 20 + 1 # where 20 is the total # of files you have >I'd like to see a randomizing function where you don't have to make some >modification to the function whenever you add a new signature to the database. >I.e., you just stick a new sig in and the program does everything else for >you. Having to go make modifications to other files seems (and actually >is, IMHO) awkward. The line now reads: @ fnum = `ls $quotedir | wc -w` @ quotenum = $quotenum % $fnum + 1 Thanks for the suggestions by others. --Cindy -- Cindy Tittle Moore Internet: tittle@ics.uci.edu | BITNET: cltittle@uci.bitnet UUCP: ...!ucbvax!ucivax!tittle | Usnail: PO Box 4188, Irvine CA, 92716
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads