Index: mttroot/mtt/bin/trans/mtt_update ================================================================== --- mttroot/mtt/bin/trans/mtt_update +++ mttroot/mtt/bin/trans/mtt_update @@ -11,10 +11,14 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.17 2002/04/28 18:41:27 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## ## Revision 1.16 2000/10/17 13:45:18 peterg ## split up state and input - different defaults ## ## Revision 1.15 2000/10/17 09:53:05 peterg ## More on logic rep @@ -73,10 +77,25 @@ if [ -z "$2" ]; then echo Usage mtt_update system representation [update] exit fi + +## Extract initial value from steady-state information +initial_value() { + i=$1 + ssfile=${sys}_ss.r + if [ "${rep}" = "state" ]; then + if [ -f "${ssfile}" ]; then + value=`grep "MTTx($i" ${ssfile}| sed 's/ //g' | gawk -F '=' '{print substr($2,1,length($2)-2)}'` + else + value=${default} + fi + else + value=${default} + fi +} rm -f mtt_empty touch mtt_empty case $rep in @@ -128,12 +147,15 @@ echo Checking $textfile else echo Creating $textfile mtt_header $sys $rep $lang > $textfile info=`cut -f1 $infofile | sort` + i=0; for new in $info; do - echo $new $default |\ + let i=$i+1; + initial_value $i; + echo $new $value |\ gawk '{printf("%s\t= %s; # Default\n",$1,$2)}' >> $textfile done exit fi