Index: mttroot/mtt/bin/trans/def2write_r ================================================================== --- mttroot/mtt/bin/trans/def2write_r +++ mttroot/mtt/bin/trans/def2write_r @@ -1,7 +1,7 @@ #!/bin/sh -set -x + ###################################### ##### Model Transformation Tools ##### ###################################### # Bourne shell script: def2write.r @@ -11,10 +11,14 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.11.2.4 2002/06/05 23:34:33 geraint +## Eliminated argument list too long warnings. +## Now get a Segmentation Fault with very long equations! +## ## Revision 1.11.2.3 2002/06/05 18:23:38 geraint ## Cosmetic change. ## ## Revision 1.11.2.2 2002/06/05 17:57:47 geraint ## Main part of optimisation routine moved to separate file. @@ -167,28 +171,22 @@ mtt_optimise () { sys="$1" lhs="$2" - + lhs=`echo $lhs | sed 's/MTTEdX/MTTdX/'` dae="${sys}_dae.r" tmp=mtt_optimise.tmp - - rhs=`eval "grep -i -e \"^$lhs\"" $dae` - rhs=`eval echo "\"$rhs"\" | gawk -v FS=":=" '{ print $2 }'` - rhs=`eval echo "\"$rhs"\" | eval "sed 's/\([.]*\)[;$]*$/\1/'"` - rhs=`eval echo "\"$rhs"\" | eval "sed 's/\ //g'"` - - if [ ! -z "${rhs}" ]; then - eval echo \"$lhs\" \"$rhs\" > $tmp - eval mtt_optimise.sh $tmp - cat $tmp #| mtt_fix_integers - fi - - return + + # get rhs and write to tmp file to be processed by mtt_optimise.sh + eval "grep -i -e \"^$lhs\"" $dae | eval "sed 's/\([.]*\)[;$]*$/\1/'" | eval "sed 's/\ //g'" | eval "sed 's/:=/ /'" > $tmp + eval mtt_optimise.sh $tmp + cat $tmp | mtt_fix_integers + + return 0 } # Remove log files rm -f def2write_r1.log def2write_r2.log