home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / infosyst / gopher / 2110 < prev    next >
Encoding:
Text File  |  1993-01-28  |  2.1 KB  |  74 lines

  1. Newsgroups: comp.infosystems.gopher
  2. Path: sparky!uunet!UB.com!pacbell.com!decwrl!concert!gatech!udel!bogus.sura.net!howland.reston.ans.net!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!news.funet.fi!ousrvr.oulu.fi!phoenix.oulu.fi!jlukkari
  3. From: jlukkari@phoenix.oulu.fi (Jyrki Lukkari)
  4. Subject: Re: Chronological order ?
  5. Message-ID: <1993Jan27.065916.24673@ousrvr.oulu.fi>
  6. Sender: news@ousrvr.oulu.fi
  7. Organization: University of Oulu, Finland
  8. X-Newsreader: TIN [version 1.1 PL6]
  9. References: <93021.095212LK-JL@finou.oulu.fi>
  10. Date: Wed, 27 Jan 1993 06:59:16 GMT
  11. Lines: 61
  12.  
  13. I have made a tool, which does just what you want. It's not beautiful
  14. and it wastes computer resources, but it works. Maybe I do later a advanced
  15. version. I hope that some finnish words in the program don't confuse 
  16. anybody.
  17.  
  18. The script is modified version of some news-script, which made links
  19. to the newest items of Gopher database. The original designer is anonymous.
  20.  
  21. Sincerely yours  Jyrki
  22.  
  23.  
  24. ---------------------------------------------------------------------------
  25.  
  26. #!/bin/sh
  27.  
  28. # Constructs .cap directories to database files, ordered in cronological
  29. # order from youngest to oldest. 
  30. #
  31.  
  32. PATH=$PATH:$HOME/bin:$HOME/bin:/usr/local/bin:/usr/bin
  33. export PATH
  34.  
  35. cd /home1/netservices/gopherot/gopher-data/Humanistinen 
  36. mv .cap .cap.old
  37. find . -name '.cap' -type d -print -exec rm -r {} \; 2> /dev/null
  38. mv .cap.old .cap
  39.  
  40. gawk '
  41.  
  42. BEGIN {
  43.  
  44.     FIND=sprintf("find . -name %c*%c -type f -ctime ", 39, 39)
  45.  
  46.     ln=1
  47.     for (days=0;days<=160 ;++days) {
  48.         DOFIND = FIND days " -print"
  49.         while (DOFIND | getline) {
  50.            name=substr($0,3)
  51.            if (index($0,".cap")) {
  52.             ;
  53.            } else {
  54.             file= $0
  55.             Sname=file
  56.             for (i=length(file);i && substr(file,i,1) != "/";--i);
  57.             dir =substr(file,1,i)
  58.             base=substr(file,i+1)
  59.             system("mkdir " dir ".cap 2> /dev/null")
  60.             capfile = dir ".cap/" base
  61.             printf "Name=%s\nNumb=%d\n", base, ln > capfile
  62.             close (capfile)
  63.             ln++
  64.             }
  65.         }
  66.         while (DOFIND | getline) {
  67.             ;
  68.         }
  69.         close (DOFIND)
  70.     }
  71.     printf "\n\n K{siteltyj{ tiedostoja oli %d\n\n\n", ln
  72. }'
  73.  
  74.