Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!eru!luth!sunic!liuida!isy!news From: Linus@Lysator.liu.se (Linus Tolke) Newsgroups: news.misc Subject: Re: Need help from rn guru Message-ID: <1990Feb12.222449.10901@isy.liu.se> Date: 12 Feb 90 22:24:49 GMT References: <22162@unix.cis.pitt.edu> <51813@bbn.COM> <22181@unix.cis.pitt.edu> Sender: news@isy.liu.se (Lord of the News) Reply-To: Linus Tolke Organization: Dept of EE, University of Linkoping Lines: 48 In article <22162@unix.cis.pitt.edu> in news.misc Jonathan Eunice writes: >I would find it enormously valuable to be able to issue an m-nk command >in rn. While rn will let me do an m-nj, it does not accept k after a >range. Would someone familiar with rn internals suggest what I would >have to change in the rn source to fix this? References to specific >source files and lines particularly appreciated. In article <22181@unix.cis.pitt.edu> in news.misc Jonathan Eunice continues: >I think of k as applying to the current article, not to a regular >expression. m-nk would then be: > > for (i = m; i <= n; i++) /* loop from m to n inclusive */ > { > i k /* junk all articles with the same > subject as article i */ > } >... >I'm aware that a naive implementation of m-nk might try to kill a >single subject several times -- once for each appearance in the range >m-n. I'm fully prepared to pay the nominal machine overhead for this >because I believe it will save me a lot of my own time. Why not write a macro to do this. Well after a few tries I understand you. The required syntax for this macro is a little bit backwards and I hope you really mean what you say in your last paragraph. Syntax for this macro is: kill900-910 <- ended with return Definition is: kill %`set \`(IFS=- read x y;echo $x $y)\`;n=$1;while test $n -le $2;do echo -n m${n}\^Mk;n=\`expr $n + 1\`;done` The ^M should be a return, change it when you do the definition. This works at om my machine. Sun UNIX 4.2 Release 3.5EXPORT and rn is the 4.3.2.2 This could cause unwanted things to happen if you are not in the right mode i.e. article selection level. The indata tests of the script are also very bad. kill900-862 should not do anything and kill900-, kill-900, kill900 causes the test to exit with error. -- /Linus Linus@Lysator.liu.se