home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume16 / narc / MakeArchiveIndex.csh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1989-01-17  |  1KB  |  80 lines

  1. #!    /bin/csh    -f
  2.  
  3. # Geoffrey Leach
  4. # LatiCorp Inc.    
  5. # {att,bellcore,sun,ames,pyramid}!pacbell!laticorp!geoff
  6.  
  7. set NAME = $0
  8. set NAME = $NAME:t
  9.  
  10. set LIST = ( \
  11.     games/v00 \
  12.     games/v01 \
  13.     games/v02 \
  14.     games/v03 \
  15.     games/v04 \
  16.     games/v05 \
  17.     misc/v02 \
  18.     misc/v03 \
  19.     misc/v04 \
  20.     misc/v05 \
  21.     x/v00 \
  22.     x/v01 \
  23.     x/v02 \
  24.     unix/v00 \
  25.     unix/v01 \
  26.     unix/v02 \
  27.     unix/v03 \
  28.     unix/v04 \
  29.     unix/v05 \
  30.     unix/v06 \
  31.     unix/v07 \
  32.     unix/v08 \
  33.     unix/v09 \
  34.     unix/v10 \
  35.     unix/v11 \
  36.     unix/v12 \
  37.     unix/v13 \
  38.     unix/v14 \
  39.     unix/v15 \
  40.     unix/v16 \
  41.     benchmarks \
  42.     graphics \
  43.     patches \
  44.     lang \
  45.     util \
  46.     text \
  47.     gnu \
  48.     doc \
  49.     dos \
  50.     lib \
  51.     alt )
  52.  
  53. cd $ARCHIVE
  54. switch ( $NAME )
  55.     case MakeArchiveIndex:    
  56.     if ( -e I ) rm I
  57.     foreach f ( ${LIST} )
  58.     awk -F: '{n = $1 " (" v "):"; \
  59.         if ( substr($2, 1, 1) == "\t" ) $2 = substr($2, 2); \
  60.         if ( substr($2, 1, 1) == "\t" ) $2 = substr($2, 2); \
  61.         $2 = substr($2,1,46); \
  62.         if ( length(n) <  8 ) n = n "\t"; \
  63.         if ( length(n) < 16 ) n = n "\t"; \
  64.         if ( length(n) < 24 ) n = n "\t"; \
  65.         printf "%s\t%s\n", n, $2 }' v=$f $f/Index  >> I
  66.     end
  67.     sort -f I > Index
  68.     rm I
  69.     exit
  70.     case PrintArchiveIndexes:
  71.     cp /dev/null ~/tmp/netls
  72.     foreach f ( ${LIST} )
  73.         ls -RC $f >> /tmp/netls
  74.     end
  75.     cd /tmp
  76.     print netls
  77.     exit
  78.     default:
  79. endsw
  80.