#!/bin/sh DATAFILE=@CVSDATA@ TEMPFILE=`mktemp` PRIORITY=50 HTML= # Parse options if [ $# -eq 0 ]; then echo "Usage: `basename $0` [-p Priority] filename" >&2 exit 1 fi OPT=`getopt -n $0 -o p: -- "$@"` if [ $? -ne 0 ]; then echo "Usage: `basename $0` [-p Priority] filename" >&2 exit 1 fi for i in $OPT do case $i in -p) PRIORITY=$2 ;; --) break ;; esac shift done HTML=$1 # add entry if [ -f "${HTML}" ]; then cat ${DATAFILE} > ${TEMPFILE} 2>/dev/null echo "${PRIORITY},${HTML}" >> ${TEMPFILE} sort -g -t ',' ${TEMPFILE} > ${DATAFILE} else echo "There is no such file." >&2 exit 1 fi # cleanup rm ${TEMPFILE}