mailnews 440 B

1234567891011121314151617181920212223242526
  1. #!/bin/rc
  2. home=/mail
  3. files=`{news -n}
  4. >$home/lib/newstime
  5. switch($#files){
  6. case 0
  7. case *
  8. subscribers=`{cat /sys/lib/subscribers}
  9. for(i in $subscribers)
  10. touch /usr/$i/lib/newstime
  11. for(file in $files){
  12. switch($file){
  13. case news:
  14. ;
  15. case *
  16. upasname=`{ls -m /lib/news/$file|sed 's/\[(.*)\]'.*/\1/}
  17. {
  18. echo 'subject: plan9 news: '^$file
  19. echo 'to: news-readers'
  20. echo
  21. news $file
  22. } | mail $subscribers
  23. }
  24. }
  25. }