Changeset 4226 for trunk/xml/lgt2txt.sh

Show
Ignore:
Timestamp:
04/25/08 16:26:46 (7 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/lgt2txt.sh

    r4220 r4226  
    1 #!/bin/bash 
     1#!/bin/sh 
    22 
    33## ================================================================ 
     
    9494done 
    9595 
    96 if [[ "$d_arg" != "" && ! -d "$d_arg" ]] 
    97 then 
     96if [ "$d_arg" != "" ] && [ ! -d "$d_arg" ] ; then 
    9897    echo "Error! directory does not exists: $d_arg" 
    9998    usage_help 
    10099    exit 1 
    101 elif [ "$d_arg" != "" ] 
    102 then 
     100elif [ "$d_arg" != "" ] ; then 
    103101    directory=$d_arg 
    104102fi 
    105103 
    106 if [[ "$p_arg" != "" && "$p_arg" != "fop" && "$p_arg" != "xep" && "$p_arg" != "xinc" ]] 
    107 then 
     104if [ "$p_arg" != "" ] && [ "$p_arg" != "fop" ] && [ "$p_arg" != "xep" ] && [ "$p_arg" != "xinc" ] ; then 
    108105    echo "Error! Unsupported XSL-FO processor: $p_arg" 
    109106    usage_help 
    110107    exit 1 
    111 elif [ "$p_arg" != "" ] 
    112 then 
     108elif [ "$p_arg" != "" ] ; then 
    113109    processor=$p_arg 
    114110fi 
    115111 
    116 if ! [[ -a "./logtalk.dtd" ]] 
    117 then 
     112if ! [ -e "./logtalk.dtd" ] ; then 
    118113    cp "$LOGTALKHOME"/xml/logtalk.dtd . 
    119114fi 
    120115 
    121 if ! [[ -a "./custom.ent" ]] 
    122 then 
     116if ! [ -e "./custom.ent" ] ; then 
    123117    cp "$LOGTALKUSER"/xml/custom.ent . 
    124118fi 
    125119 
    126 if ! [[ -a "./logtalk.xsd" ]] 
    127 then 
     120if ! [ -e "./logtalk.xsd" ] ; then 
    128121    cp "$LOGTALKHOME"/xml/logtalk.xsd . 
    129122fi 
    130123 
    131 if [[ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ]] 
    132 then 
     124if [ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ] ; then 
    133125    echo 
    134126    echo "converting XML files to text files..."