All pastes #526083 Raw Edit

Something

public text v1 · immutable
#526083 ·published 2007-05-31 17:28 UTC
rendered paste body
#
#
#
#
#       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