How not to let field overflow ?

Hi All

I ahve a basic script with a screen. Is there anyway that I can make it possible for the user not to type over the ] ie I would like the inpu to be only with the brakcets?

Any suggestions welcome. :b:

eg

DB name:[           ]

function get_fdb {

   while [[ 1 -eq 1 ]]
   do
      tput cup 9 41
      read FDB
      if [[ -n $FDB ]]
      then
         chkdb ${FDB}

         if [[ $? -eq 0 ]]
         then                                   
            break
         else
            disperr "From DB does not exist" 1
         fi
      fi
   done
}

simple answer is no!

you could write a script that
1)asks the user to input values for each parameter one by one
2)then recreates the aforementioned file with the user input values - that way they don't even have to open the file in the first place - which is a better way of ensuring that noone trashes the file