# Junker:  Creates news directories and/or send files to them, or removes
#          files from the junk dir.

SL="/" ; Nxt=".next"
cd uunews:junk
echo
NName=$(ls)
   for Num in $NName
   do if [ "$Num" -ne ".*" ] then ILine=$(fgrep Newsgroups: $Num) ; fi
      Line=$(cdr "$ILine" ' ')
      if [ -d "uunews:$Line" ] then echo "$Line (Exists)" ; else echo "$Line"
      fi
      echo -n "Create, Jump, Remove, or Send? (c,j,r,s,q) " ; read Rsp
      if [ "$Rsp"="c" ] then mkdir uunews:$Line ; NxtOne="1"
         cp $Num uunews:$Line$SL$NxtOne ; echo "2" > uunews:$Line$SL$Nxt
         rm $Num ; echo $Line >> uulib:.newsrc
         echo "$Line 4" >> uulib:NewsGroups ; continue
      elif [ "$Rsp"="j" ] then continue
      elif [ "$Rsp"="s" ] then NxtOne=$(cat uunews:$Line$SL$Nxt)
            cp $Num ram: ; rename ram:$Num ram:$NxtOne ; 
            cp ram:$NxtOne uunews:$Line$SL$NxtOne ; rm ram:$NxtOne
            inc NxtOne ; echo $NxtOne > uunews:$Line$SL$Nxt ; rm $Num ; continue
      elif [ "$Rsp"="r" ] then rm $Num ; continue
      elif [ "$Rsp"="q" ] then break
      fi
   done
cd vd0:

