libreccm-legacy/ccm-shp-aplaws/doc/docs-stuff/db2indexedpg-ps

50 lines
1007 B
Bash
Executable File

#! /bin/sh
# Modified for a specified list of pages by Tammy Fox <tfox@redhat.com>
# Make sure we have an absolute path to the backend and stylesheet, as
# jw doesn't like relative paths...
STUFFPATH=`dirname $0`
if [ -n "${STUFFPATH##/*}" ]
then
STUFFPATH=$PWD/$STUFFPATH
fi
DVI_PAGES=$1
FILENAME=$2
export DVI_PAGES
if [ "$1" == "" ] || [ "$2" == "" ] ; then
echo "Usage: $0 <page-nums> <parent-file>"
echo "example: $0 42-50 rhl-cg-en.sgml"
exit 1
fi
#
#Grab name of the SGML file without extension
#
FILENAME="`echo $FILENAME | sed 's,\.sgml$,,;s,\.sgm$,,'`"
# Generate index
jw -f docbook \
-b $STUFFPATH/index \
-d $STUFFPATH/stylesheets/redhat.dsl#html \
-o $FILENAME-tmp \
${FILENAME}.sgml
# Generate PS with generated index
jw -f docbook \
-b $STUFFPATH/indexedpg-ps \
-d $STUFFPATH/stylesheets/redhat.dsl#print \
${FILENAME}.sgml
# Remove temp directory
echo -n Removing temp directory $PWD/$FILENAME-tmp...
rm -rf $PWD/$FILENAME-tmp
echo Done!