Path: utzoo!mnetor!uunet!lll-winken!ubvax!vsi1!unisv!vanpelt From: vanpelt@unisv.UUCP (Mike Van Pelt) Newsgroups: news.misc Subject: Re: usr/spool/news/junk runneth over Message-ID: <227@unisv.UUCP> Date: 18 Mar 88 04:26:12 GMT References: <213@unisv.UUCP> Organization: Unisys Silicon Valley, San Jose, CA Lines: 41 Summary: Revised version of 'unjunk', for new news sites where the junk newsgroup is running over. I found a bug in my previous posting of the 'unjunk' script. If there were no cross-posted articles in junk, the global replace for ',' with newline would fail, and the rest of the ed script would not be executed. (%$#%@!!) Here's the corrected script. ====== begin script ======= #!/bin/sh # Shell to create new newsgroups from the Newsgroups: line in every # article in ../news/junk, remove everything from junk, and repost # it all in the appropriate new newsgroups. # # ** WARNING ** Doesn't create the group if there is only one message # in /news/junk. # cd /usr/lib/news mkdir landfill cp /usr/spool/news/junk/* landfill echo "gag,retch" >fixup1 grep \^Newsgroups: landfill/* | cut -f3 -d: | sort | uniq >>fixup1 ed - fixup1 <<'EOF' 1,$s/,/\ /g 1,2d 1,$s/^/inews -C / 1,$s;$; fixup2 ed - fixup2 <<'EOF' 1,$s;^;inews -x vsi1 -h -p landfill/; w q EOF sh fixup2 ====== end script ======= Hope that takes care of it! -- Mike Van Pelt ..uunet!ubvax!unisv!vanpelt