home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / interfaces / gnus-mail.shar / make-active < prev    next >
Encoding:
Text File  |  1991-05-03  |  903 b   |  42 lines

  1. #!/bin/cshe -f
  2. #
  3. # Builds a pseudoactive file which represents personal mail under
  4. # $1 plus pseudonews in $1/{comp,soc,rec,talk,sci,soc,misc,...}.
  5. #
  6. if ($#argv < 2) then
  7.     echo make-active: usage: make-active directory-subdirs...
  8.     exit 87
  9. endif
  10. set dir=$1
  11. shift
  12. set active=$dir/active
  13. set nactive=/usr/lib/news/active
  14. #
  15. # Find directories and their associated .last files.  Then take
  16. # base dirnames, change to newsgroup name format, and build the
  17. # mail-based active file out of it all.
  18. #
  19. cd $dir
  20. set list=($*)
  21. set count=$#list
  22. set nlist=()
  23. set first=()
  24. set last=()
  25. foreach i ($list)
  26.     set first=($first $i/.first)
  27.     set last=($last $i/.last)
  28.     set nlist=($nlist `echo $i | tr / .`)
  29. end
  30. cp /dev/null $active
  31. @ i = 1
  32. while ($i <= $count)
  33.     echo $nlist[$i] `cat $last[$i]` `cat $first[$i]` n >> $active
  34.     @ i ++
  35. end
  36. #
  37. ## Defunctitude:
  38. # Now add the whole regular active file.
  39. cat $nactive >> $active
  40. #
  41. exit 0
  42.