Path: utzoo!attcan!uunet!ginosko!ctrsol!cica!iuvax!rutgers!cbmvax!vu-vlsi!dsinc!syd From: syd@DSI.COM (Syd Weinstein) Newsgroups: news.software.b Subject: Re: Review of NN, a Usenet news reader Keywords: rn, .newsrc, b&d Message-ID: <1989Jul31.004543.12150@DSI.COM> Date: 31 Jul 89 00:45:43 GMT References: <1836@papaya.bbn.com> <1150@sequent.cs.qmc.ac.uk> <1050@unocss.UUCP> <402@laas.laas.fr> <2794@mace.cc.purdue.edu> <693@aurora.AthabascaU.CA> Reply-To: syd@DSI.COM Organization: Datacomp Systems, Inc. Huntingdon Valley, PA Lines: 83 My workaround for this problem is that I wrote a perl script that takes the .nn/rc file and updates my .newsrc from that. I know, its a kludge, but it lets arbitron, and our other local managment items handle things correctly. Here it is, its not very long, you run the up shell script and it updates the .newsrc file. #!/bin/sh # shar: Shell Archiver (v1.22) # # Run the following text with /bin/sh to create: # bin/up # bin/updnsrc.p # sed 's/^X//' << 'SHAR_EOF' > bin/up && Xperl ~/bin/updnsrc.p > ~/.newsrc.new Xmv ~/.newsrc ~/.newsrc.bak Xmv ~/.newsrc.new ~/.newsrc SHAR_EOF chmod 0700 bin/up || echo "restore of bin/up fails" sed 's/^X//' << 'SHAR_EOF' > bin/updnsrc.p && X#!/usr/local/bin/perl Xeval "exec /usr/local/bin/perl /usr/local/bin/bdf $*" X if $running_via_sh; X X$home=$ENV{"HOME"}; Xdie "cannot open nn file" unless open(nn, "$home/.nn/rc"); Xwhile () X { X chop; X ($flag, $max, $group) = split; X $flags{$group} = $flag; X $maxs{$group} = $max + 0 if $flag eq "+"; X } Xclose(nn); X Xdie "cannot open nn file" unless open(rn, "$home/.newsrc"); Xwhile () X { X if (/:/) { X ($group, $rest) = split(/:/); X $flag = $flags{$group}; X if ( $flag eq "+") X { X $max = $maxs{$group}; X print "$group: 1-$max\n" if $max; X print "$group:\n" unless $max; X } X else X { X print "$group!\n"; X } X } X elsif (/!/) { X ($group, $rest) = split(/!/); X $flag = $flags{$group}; X if ( $flag eq "+") X { X $max = $maxs{$group}; X print "$group: 1-$max\n" if $max; X print "$group:\n" unless $max; X } X else X { X print "$group!\n"; X } X } X else X { X print "$_"; X } X } X SHAR_EOF chmod 0755 bin/updnsrc.p || echo "restore of bin/updnsrc.p fails" exit 0 -- ===================================================================== Sydney S. Weinstein, CDP, CCP Elm Coordinator Datacomp Systems, Inc. Voice: (215) 947-9900 syd@DSI.COM or {bpa,vu-vlsi}!dsinc!syd FAX: (215) 938-0235