#!/bin/bash
#
# by Chih-Wei Huang
#                        17 August 1998
#                Updated 20 September 1998
#

PATH=.:$PATH
FUNCTIONS="`type -path bg5sgmlfunctions`"
if [ -z $FUNCTIONS ]; then
    echo "$0: include file not found!"
    exit 1
fi
. $FUNCTIONS


for src in $filelist
do
    checksrcfile $src
    [ $? = 0 ] && continue

    encodingbg5 $src

    pushd . > /dev/null
    cd $TMP
    sgml2lyx $options $name.sgml
    [ -e $name.lyx ] || exit 2
    popd > /dev/null

    $B2A -d -f $TMP/$name.lyx -o $name.lyx
done

cleartmp
