#! /bin/sh set -e trap "rm -f Index-*.$$; exit 0" 0 1 2 3 4 5 15 cd /archive /usr/local/etc/mkindex .[0-9] .[a-z] \ | sed -e 's: \.[0-9]/: pub/:' \ > Index-byname.$$ compress Index-byname.Z.$$ sort -n -r Index-byname.$$ >Index-bytime.$$ compress Index-bytime.Z.$$ for x in name time do mv Index-by${x}.$$ Index-by${x} mv Index-by${x}.Z.$$ Index-by${x}.Z done exit 0