# # # # # Verifytxt: verifies that the text data field is what the user wants it to be. # Syntax: xxx=`verifytxt "Prompt for user" "Contents of data text field"` # Example: answer=`verifytxt "$Prompt_for_message_count" "$count"` # function verifytxt { desc=$1 name=$2 read ans?"$desc : $name Enter a new value or just press enter to keep the current value >> " if [ "x$ans" != x ] ; then ans=`verifytxt "$desc" "$ans"` echo $ans else echo $name fi } typeset -xf verifytxt