Index: mttroot/mtt/bin/trans/mtt_update ================================================================== --- mttroot/mtt/bin/trans/mtt_update +++ mttroot/mtt/bin/trans/mtt_update @@ -11,10 +11,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.1 2000/10/12 12:32:23 peterg +## Initial revision +## ## ############################################################### sys=$1 # System name @@ -22,12 +25,17 @@ textfile=$1_$2.txt infofile=$1_sympar.txt default='0.0' -# Inform User -echo Checking $textfile +if [ -f "$textfile" ]; then + # Inform User + echo Checking $textfile +else + sympar2numpar_txt2txt $1 + exit +fi # Remove tmp files rm -f mtt_in_text mtt_in_info # Strip files @@ -60,17 +68,18 @@ echo "The following variables are defined in $textfile, but do not exist:" echo $in_text while [ -z "$answered" ]; do echo "Update $textfile (y/n)?" - read answer + read answer < /dev/tty case $answer in y) answered=yes for old in $in_text; do sed "s/\($old[ \t]*=\)/## Removed by MTT on `date`: \1/" <$textfile > mtt_tmp mv mtt_tmp $textfile + changed=yes done ;; n) answered=yes ;; @@ -85,22 +94,21 @@ echo "The following variables exist, but are not defined in $textfile:" echo $in_info while [ -z "$answered" ]; do echo "Update $textfile (y/n)?" - read answer + read answer < /dev/tty case $answer in y) answered=yes for new in $in_info; do echo "$new = $default; # Added by MTT on `date`" >> $textfile + changed=yes done ;; n) answered=yes ;; *) esac done fi - -