Listing 6: makelist--A script that generates lists of files to be checked
#!/bin/sh
#
# Automate the generation of lists of files to check
#
TMPF=/tmp/$$.final
if [ $1 = "-d" ]; then
a_date () { /bin/ls -Llg $1 | tail +2 | sed -f transform -e 's/^-/0/g'\
| awk '{print $9":"$1":"$3":"$4":---"}' >> $TMPF; }
else
a_date () { /bin/ls -Llg $1 | tail +2 | sed -f transform -e 's/^-/0/g'\
|awk'{print$9":"$1":"$3":"$4":"$7"."$6"."$
8}' >> $TMPF ; }
fi
for arg in $*
do
if [ $arg != "-d" ]; then
echo "%"$arg >> $TMPF
a_date $arg
fi
done
cat $TMPF
rm $TMPF
|