#!/bin/sh # PATH="${IW:-/iw}/skulker/edgar/current/bin:$PATH" # files to convert FILES="$@" ##echo "Fixing nc files ..." fix-nc ${FILES} status=$? if [ $status -ne 0 ] ; then echo "Error ($status) from fix-nc"; exit 1 fi ##echo "XML conversion and validation ..." for f in ${FILES} ; do file=`echo $f | sed -e 's#^.*/##' | awk -F. '{print $1}'` if [ -f $file.nc ] ; then /iw/sp/current/bin/sx -wall -f $file.errs -xempty -xno-nl-in-tag $file.nc > $file.xml [ ! -s $file.errs ] && rm $file.errs [ -s $file.errs ] && rm $file.xml fi done ##echo "Fixing XML ..." for f in ${FILES} ; do file=`echo $f | sed -e 's#^.*/##' | awk -F. '{print $1}'` if [ -f $file.xml ] ; then fix-xml $file.xml status=$? if [ $status -ne 0 ] ; then echo "Error ($status) from fix-xml"; exit 1 fi fi done exit 0