home *** CD-ROM | disk | FTP | other *** search
/ Carousel / CAROUSEL.cdr / mactosh / unix / unix_mac.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1985-06-07  |  2KB  |  54 lines

  1. #! /bin/sh
  2. # Shellscript for xbin'ing new net.sources.mac posts to one directory for macput
  3. #     Gets files to xbin from comm'ing the file '.lastls' in the download 
  4. #    directory and the new net.sources.mac directory.
  5. # This shellscript will ignore directories and files that are unreadable,
  6. #     as well as any files without the line "(This file must be converted...)"
  7. #
  8. # Upon termination of the operation, the Macintosh bell will ring
  9. #    two times.  This is your clue to wake up and see what is waiting.
  10. #     This might be deleted if you plan to do this in the background and 
  11. #    don't want to be bothered.
  12. #
  13. # Done on 1 June 1985 by 
  14. # Chris Borton, UC San Diego Undergraduate CS
  15. #{ucbvax,decvax,akgua,dcdwest}!sdcsvax!sdcc6!ix924    
  16. #
  17. # User modifications necessary:
  18. #
  19. #  DLDIR:   replace "Download directory" with the full path to the 
  20. #        directory you wish to put the files to download.
  21. #  SOURCES: replace "/usr/spool/news/net/sources/mac" with the path to your 
  22. #          net.sources.mac if it is different.
  23.  
  24. DLDIR="Download directory"
  25. SOURCES="/usr/spool/news/net/sources/mac"
  26.  
  27. ls $SOURCES > $DLDIR/.thisls
  28. mesg n
  29. for f in `comm -23 $DLDIR/.thisls $DLDIR/.lastls`
  30. do
  31.     if [ -f $SOURCES/$f ] && [ -r $SOURCES/$f ]
  32.     then
  33.         fgrep "(This file must be " $SOURCES/$f > /tmp/BinHextest
  34.         if [ -s /tmp/BinHextest ]
  35.         then
  36.             rm /tmp/BinHextest
  37.             cp $SOURCES/$f $DLDIR
  38.             cd $DLDIR
  39.             xbin $f
  40.             rm $f
  41.             cd $SOURCES
  42.         else
  43.             rm /tmp/BinHextest
  44.         fi
  45.     fi
  46.  done
  47.  mv $DLDIR/.thisls $DLDIR/.lastls
  48.  rm $DLDIR/.thisls
  49.  echo "Downloads ready!"
  50.  echo -n 
  51.  echo -n 
  52.  mesg y
  53.