home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.infosystems.gopher
- 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
- From: jlukkari@phoenix.oulu.fi (Jyrki Lukkari)
- Subject: Re: Chronological order ?
- Message-ID: <1993Jan27.065916.24673@ousrvr.oulu.fi>
- Sender: news@ousrvr.oulu.fi
- Organization: University of Oulu, Finland
- X-Newsreader: TIN [version 1.1 PL6]
- References: <93021.095212LK-JL@finou.oulu.fi>
- Date: Wed, 27 Jan 1993 06:59:16 GMT
- Lines: 61
-
- I have made a tool, which does just what you want. It's not beautiful
- and it wastes computer resources, but it works. Maybe I do later a advanced
- version. I hope that some finnish words in the program don't confuse
- anybody.
-
- The script is modified version of some news-script, which made links
- to the newest items of Gopher database. The original designer is anonymous.
-
- Sincerely yours Jyrki
-
-
- ---------------------------------------------------------------------------
-
- #!/bin/sh
-
- # Constructs .cap directories to database files, ordered in cronological
- # order from youngest to oldest.
- #
-
- PATH=$PATH:$HOME/bin:$HOME/bin:/usr/local/bin:/usr/bin
- export PATH
-
- cd /home1/netservices/gopherot/gopher-data/Humanistinen
- mv .cap .cap.old
- find . -name '.cap' -type d -print -exec rm -r {} \; 2> /dev/null
- mv .cap.old .cap
-
- gawk '
-
- BEGIN {
-
- FIND=sprintf("find . -name %c*%c -type f -ctime ", 39, 39)
-
- ln=1
- for (days=0;days<=160 ;++days) {
- DOFIND = FIND days " -print"
- while (DOFIND | getline) {
- name=substr($0,3)
- if (index($0,".cap")) {
- ;
- } else {
- file= $0
- Sname=file
- for (i=length(file);i && substr(file,i,1) != "/";--i);
- dir =substr(file,1,i)
- base=substr(file,i+1)
- system("mkdir " dir ".cap 2> /dev/null")
- capfile = dir ".cap/" base
- printf "Name=%s\nNumb=%d\n", base, ln > capfile
- close (capfile)
- ln++
- }
- }
- while (DOFIND | getline) {
- ;
- }
- close (DOFIND)
- }
- printf "\n\n K{siteltyj{ tiedostoja oli %d\n\n\n", ln
- }'
-
-