Index: mttroot/mtt/bin/trans/mtt_header ================================================================== --- mttroot/mtt/bin/trans/mtt_header +++ mttroot/mtt/bin/trans/mtt_header @@ -10,10 +10,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.21 2000/12/04 08:52:40 peterg +## Zapped () in functions for sh compatibility +## ## Revision 1.20 2000/12/04 08:19:27 peterg ## Added switch declarations - in logic.cc ## ## Revision 1.19 2000/12/03 16:11:43 peterg ## Corrected bug in logic declatations @@ -490,30 +493,30 @@ function get_extra_fields { # return list of words in s2 and not in s1 s1=${1:-""} # comma separated list s2=${2:-""} # comma separated list - c1=$(get_field ${s1} 0) # count words in s1 - c2=$(get_field ${s2} 0) # count words in s2 + c1=`get_field ${s1} 0` # count words in s1 + c2=`get_field ${s2} 0` # count words in s2 ans="" i2=0 # s2 word index while [ ${i2} -lt ${c2} ]; do flag=0 # appearance of word in s1 and s2? - i2=$((${i2} + 1)) - w2=$(get_field ${s2} ${i2}) # i2 th word in s2 + i2=`expr ${i2} + 1` + w2=`get_field ${s2} ${i2}` # i2 th word in s2 i1=0 # s1 word index while [ ${i1} -lt ${c1} ]; do - i1=$((${i1} + 1)) - w1=$(get_field ${s1} ${i1}) # i1 th word in s1 + i1=`expr ${i1} + 1` + w1=`get_field ${s1} ${i1}` # i1 th word in s1 if [ ${w2} = ${w1} ]; then flag=1 # w2 occurs in s1 fi done if [ ${flag} -eq 0 ]; then # w2 is not in s1? - if [ -z ${ans} ]; then # string is empty? + if [ -z ${ans:-""} ]; then # string is empty? ans=${w2} # assign w2 else ans=${ans},${w2} # append w2 fi fi @@ -536,11 +539,11 @@ #include "${system}_sympar.h" DEFUN_DLD (${system}_${rep}, args, , "Usage: [$output] = ${system}_${rep}($args) Octave ${rep} representation of system ${system} -Generated by MTT on $(date)") +Generated by MTT on `date`") { octave_value_list retval; EOF @@ -548,18 +551,18 @@ function map_DLD_inputs { s=${1:-""} # comma separated input list - if [ -z ${s} ];then return; fi - c=$(get_field ${s} 0) # count of inputs + if [ -z ${s:-""} ];then return; fi + c=`get_field ${s} 0` # count of inputs i=0 printf " if (${c} != args.length ()) usage (\"${fun_name} expected ${c} argument(s): ${s}\");\n\n" while [ ${i} -lt ${c} ]; do j=${i} - i=$((${i} + 1)) - w=$(get_field ${s} ${i}) # argument name + i=`expr ${i} + 1` + w=`get_field ${s} ${i}` # argument name get_arg_specific_stuff ${w} case ${arg_type} in "const double") printf " ${arg_type}\t${w}\t= args(${j}).double_value ();\n" ;; @@ -573,35 +576,35 @@ function declare_DLD_outputs { s=${1:-""} # comma separated output list - c=$(get_field ${s} 0) # count of outputs + c=`get_field ${s} 0` # count of outputs i=0 while [ ${i} -lt ${c} ]; do - i=$((${i} + 1)) - w=$(get_field ${s} ${i}) # argument name + i=`expr ${i} + 1` + w=`get_field ${s} ${i}` # argument name get_arg_specific_stuff ${w} printf " ${arg_type}\t${w}\t${arg_size};\n" done } function return_DLD_outputs { s=${1:-""} # comma separated output list - c=$(get_field ${s} 0) # count of outputs + c=`get_field ${s} 0` # count of outputs i=0 cat <