home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / CNEWS / _CNEWS.TAR / usr / lib / newsbin / batch / batchra < prev    next >
Encoding:
Text File  |  1994-09-02  |  810 b   |  27 lines

  1. #! /bin/sh
  2. # batchra [file...] - requested-articles batcher - read sendme message(s),
  3. # look up history entries and get file names, append the names to batch file
  4.  
  5. # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  6. . ${NEWSCONFIG-/var/lib/news/bin/config}
  7. export NEWSCTL NEWSBIN NEWSARTS NEWSPATH NEWSUMASK NEWSMASTER NEWSCONFIG
  8. PATH=$NEWSCTL/bin:$NEWSBIN/batch:$NEWSBIN:$NEWSPATH; export PATH
  9.  
  10. batchdir=`expr "$NEWSSITEDIR" : "^\(.*\)\.[^./]*$"`
  11. case "$batchdir" in
  12. '')    batchdir="$NEWSARTS/out.going/$NEWSSITE"    ;;
  13. esac
  14. files="`cat $*`"
  15. export batchdir files
  16.  
  17. SHELL=/bin/sh $NEWSBIN/maint/locknews <<'!'
  18.     for f in $files
  19.     do
  20.         if test -r $f    # ignore control files that have vanished
  21.         then
  22.             sed '1,/^$/d' $f
  23.         fi
  24.     done | egrep '^<' | dbz -x $NEWSCTL/history |
  25.     sed 's/^.*    \([^ ]*\).*$/\1/' | tr . / >>$batchdir/togo
  26. !
  27.