Changeset 4226 for trunk/xml/lgt2html.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/lgt2html.sh

    r4102 r4226  
    1 #!/bin/bash 
     1#!/bin/sh 
    22 
    33## ================================================================ 
     
    154154done 
    155155 
    156 if [[ "$f_arg" != "" && "$f_arg" != "xhtml" && "$f_arg" != "html" ]] 
    157 then 
     156if [ "$f_arg" != "" ] && [ "$f_arg" != "xhtml" ] && [ "$f_arg" != "html" ] ; then 
    158157    echo "Error! Unsupported output format: $f_arg" 
    159158    usage_help 
    160159    exit 1 
    161 elif [ "$f_arg" != "" ] 
    162 then 
     160elif [ "$f_arg" != "" ] ; then 
    163161    format=$f_arg 
    164162fi 
    165163 
    166 if [[ "$d_arg" != "" && ! -d "$d_arg" ]] 
    167 then 
     164if [ "$d_arg" != "" ] && [ ! -d "$d_arg" ] ; then 
    168165    echo "Error! directory does not exists: $d_arg" 
    169166    usage_help 
    170167    exit 1 
    171 elif [ "$d_arg" != "" ] 
    172 then 
     168elif [ "$d_arg" != "" ] ; then 
    173169    directory=$d_arg 
    174170fi 
    175171 
    176 if [[ "$i_arg" != "" ]] 
    177 then 
     172if [ "$i_arg" != "" ] ; then 
    178173    index_file=$i_arg 
    179174fi 
    180175 
    181 if [[ "$t_arg" != "" ]] 
    182 then 
     176if [ "$t_arg" != "" ] ; then 
    183177    index_title=$t_arg 
    184178fi 
    185179 
    186 if [[ "$p_arg" != "" && "$p_arg" != "xsltproc" && "$p_arg" != "xalan" && "$p_arg" != "sabcmd" ]] 
    187 then 
     180if [ "$p_arg" != "" ] && [ "$p_arg" != "xsltproc" ] && [ "$p_arg" != "xalan" ] && [ "$p_arg" != "sabcmd" ] ; then 
    188181    echo "Error! Unsupported XSLT processor: $p_arg" 
    189182    usage_help 
    190183    exit 1 
    191 elif [ "$p_arg" != "" ] 
    192 then 
     184elif [ "$p_arg" != "" ] ; then 
    193185    processor=$p_arg 
    194186fi 
    195187 
    196 if [ "$format" = "xhtml" ] 
    197 then 
     188if [ "$format" = "xhtml" ] ; then 
    198189    xslt=$xhtml_xslt 
    199190else 
     
    201192fi 
    202193 
    203 if ! [[ -a "./logtalk.dtd" ]] 
    204 then 
     194if ! [ -e "./logtalk.dtd" ] ; then 
    205195    cp "$LOGTALKHOME"/xml/logtalk.dtd . 
    206196fi 
    207197 
    208 if ! [[ -a "./custom.ent" ]] 
    209 then 
     198if ! [ -e "./custom.ent" ] ; then 
    210199    cp "$LOGTALKUSER"/xml/custom.ent . 
    211200fi 
    212201 
    213 if ! [[ -a "./logtalk.xsd" ]] 
    214 then 
     202if ! [ -e "./logtalk.xsd" ] ; then 
    215203    cp "$LOGTALKHOME"/xml/logtalk.xsd . 
    216204fi 
    217205 
    218 if ! [[ -a "$directory/logtalk.css" ]] 
    219 then 
     206if ! [ -e "$directory/logtalk.css" ] ; then 
    220207    cp "$LOGTALKUSER"/xml/logtalk.css "$directory" 
    221208fi 
    222209 
    223 if [[ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ]] 
    224 then 
     210if [ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ] ; then 
    225211    echo 
    226212    echo "converting XML files..."