Changeset 4226 for trunk/xml/lgt2pdf.sh

Show
Ignore:
Timestamp:
04/25/08 16:26:46 (5 months ago)
Author:
pmoura
Message:

Updated the "lgt2*.sh" shell scripts for POSIX compliance, removing dependencies on bash shell features.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/xml/lgt2pdf.sh

    r4102 r4226  
    1 #!/bin/bash 
     1#!/bin/sh 
    22 
    33## ================================================================ 
     
    100100done 
    101101 
    102 if [[ "$f_arg" != "" && "$f_arg" != "a4" && "$f_arg" != "us" ]] 
    103 then 
     102if [ "$f_arg" != "" ] && [ "$f_arg" != "a4" ] && [ "$f_arg" != "us" ] ; then 
    104103    echo "Error! Unsupported output format: $f_arg" 
    105104    usage_help 
     
    110109fi 
    111110 
    112 if [[ "$d_arg" != "" && ! -d "$d_arg" ]] 
    113 then 
     111if [ "$d_arg" != "" ] && [ ! -d "$d_arg" ] ; then 
    114112    echo "Error! directory does not exists: $d_arg" 
    115113    usage_help 
    116114    exit 1 
    117 elif [ "$d_arg" != "" ] 
    118 then 
     115elif [ "$d_arg" != "" ] ; then 
    119116    directory=$d_arg 
    120117fi 
    121118 
    122 if [[ "$p_arg" != "" && "$p_arg" != "fop" && "$p_arg" != "xep" && "$p_arg" != "xinc" ]] 
    123 then 
     119if [ "$p_arg" != "" ] && [ "$p_arg" != "fop" ] && [ "$p_arg" != "xep" ] && [ "$p_arg" != "xinc" ] ; then 
    124120    echo "Error! Unsupported XSL-FO processor: $p_arg" 
    125121    usage_help 
    126122    exit 1 
    127 elif [ "$p_arg" != "" ] 
    128 then 
     123elif [ "$p_arg" != "" ] ; then 
    129124    processor=$p_arg 
    130125fi 
    131126 
    132 if [ "$format" = "a4" ] 
    133 then 
     127if [ "$format" = "a4" ] ; then 
    134128    xsl=$a4_xsl 
    135129else 
     
    137131fi 
    138132 
    139 if ! [[ -a "./logtalk.dtd" ]] 
    140 then 
     133if ! [ -e "./logtalk.dtd" ] ; then 
    141134    cp "$LOGTALKHOME"/xml/logtalk.dtd . 
    142135fi 
    143136 
    144 if ! [[ -a "./custom.ent" ]] 
    145 then 
     137if ! [ -e "./custom.ent" ] ; then 
    146138    cp "$LOGTALKUSER"/xml/custom.ent . 
    147139fi 
    148140 
    149 if ! [[ -a "./logtalk.xsd" ]] 
    150 then 
     141if ! [ -e "./logtalk.xsd" ] ; then 
    151142    cp "$LOGTALKHOME"/xml/logtalk.xsd . 
    152143fi 
    153144 
    154 if [[ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ]] 
    155 then 
     145if [ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ] ; then 
    156146    echo 
    157147    echo "converting XML files to PDF..."