home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / Programming / Source / Weather / Weather.app / other / getGif < prev    next >
Encoding:
Text File  |  1992-07-10  |  742 b   |  49 lines

  1. #! /bin/csh -f
  2. # fetch and open a recent weather map files from vmd.cso.uiuc.edu:wx/...
  3. # do:
  4. #    getGif 3 CV     for satellite photos
  5. #    getGif 3 SA     for surface/radar photos
  6. #
  7. set n = $1 ; shift
  8. set m = 128.174.5.98    # vmd.cso.uiuc.edu
  9. set p = wx
  10. set t = /tmp/W_maps
  11. mkdirs $t
  12. cd $t
  13.  
  14. ftp -i -n $m > list <<eof
  15. user anonymous guest
  16. cd $p
  17. ls $1*
  18. quit
  19. eof
  20.  
  21. set f = `tail -$n list`
  22.  
  23. ftp -i -n $m <<eof
  24. user anonymous guest
  25. cd $p
  26. bin
  27. mget $f
  28. quit
  29. eof
  30.  
  31. # make sure we got something
  32. foreach i ($f)
  33.     test -s $i
  34.     if ($status) then
  35.             echo "Couldn't get weather map $i" | open
  36.             exit
  37.     else
  38. end
  39.  
  40. # rename ...GIF => ...gif
  41. set o = ""
  42. foreach i ($f)
  43.     set ff = $i:r.gif
  44.     mv $i $ff
  45.     set o = ($o $ff)
  46. end
  47.  
  48. open $o
  49.