From: Andrew_Gilmartin@Brown.Edu Newsgroups: alt.gopher Subject: WAIS directory script Date: 6 Jul 92 22:36:39 GMT Attached is a script I am using to build our WAIS sources directory from the list maintained at quake.think.com. You only need make two changes for use at most sites. If you find bugs or have comments, please send email. -- Andrew -- Andrew Gilmartin Computing & Information Services Brown University Andrew_Gilmartin@Brown.Edu (401) 863-7305 #!/bin/sh -x # This shell script creates a Gopher directory structure containing all # the WAIS sources files kept at quake.think.com. Since the number of # sources now exceeds 200, the sources are organized alphabetically. # # Change the shell variable "to" on line 16 and replace with # your email address on line 30. # # AUTHOR: Andrew_Gilmartin@Brown.Edu # MODIFIED: 7/6/92 # Where to place the WAIS files # NOTE: First command line argument overrides default to=${1-"/usr/users/andrew/cwis/nfsmount/cwis/wais"} # Create tmp directory to work in tmp=/tmp/gopher-wais-load rm -fr ${tmp} mkdir ${tmp} cd ${tmp} # Get list of WAIS sources ftp -n quake.think.com < binary cd wais get wais-sources.tar.Z bye ! # Unpack them zcat wais-sources.tar.Z | tar -xf - # Make all the directories rm -r ${to} mkdir ${to} mkdir ${to}/.cap for dir in a b c d e f g h i j k l m n o p q r s t u v w x y z do mkdir ${to}/${dir} done # Distribute WAIS sources cd ${tmp}/wais-sources for file in `ls` do # Where to put the file? case $file in A*|a*) dir=a ;; B*|b*) dir=b ;; C*|c*) dir=c ;; D*|d*) dir=d ;; E*|e*) dir=e ;; F*|f*) dir=f ;; G*|g*) dir=g ;; H*|h*) dir=h ;; I*|i*) dir=i ;; J*|j*) dir=j ;; K*|k*) dir=k ;; L*|l*) dir=l ;; M*|m*) dir=m ;; N*|n*) dir=n ;; O*|o*) dir=o ;; P*|p*) dir=p ;; Q*|q*) dir=q ;; R*|r*) dir=r ;; S*|s*) dir=s ;; T*|t*) dir=t ;; U*|u*) dir=u ;; V*|v*) dir=v ;; W*|w*) dir=w ;; X*|x*) dir=x ;; Y*|y*) dir=y ;; Z*|z*) dir=z ;; *) dir=other ;; esac # Move the file mv $file ${to}/${dir}/ done # Create entry for directory of servers cp ${to}/d/directory-of-servers.src ${to}/. cat >${to}/.cap/directory-of-servers.src <