diff --git a/tpromptuser.sh b/tpromptuser.sh index e60cce8..aebb41a 100755 --- a/tpromptuser.sh +++ b/tpromptuser.sh @@ -2,7 +2,7 @@ # promptuser.sh - User Prompting From Shell With validation # Copyright (c) 2010, TundraWare Inc, Des Plaines, IL USA # All Rights Reserved -# $Id: tpromptuser.sh,v 1.104 2010/10/07 19:12:17 tundra Exp $ +# $Id: tpromptuser.sh,v 1.105 2010/10/07 19:21:14 tundra Exp $ # Loop through a set of questions for the user to answer, storing # their response back into the prompt variable itself. @@ -33,14 +33,90 @@ ORIGIFS=$IFS # Save current field separator DL=';' # Prompt field delimiter +# ---------- Nothing Should Change Below This Line ---------- # + +##### +# PromptUser() - Shell Function To Prompt And Validate User Input +##### + +PromptUser() + +{ + + for x in $PROMPTLIST + do + eval record=\$$x # Get the prompt record + IFS=$DL # Get individual fields + read prompt default answers <$foo bar->$bar baz->$baz bat->$bat" -# ---------- Nothing Should Change Below This Line ---------- # +# Go get the user input and validate it -##### -# Actual Prompting Logic -##### - - -for x in $PROMPTLIST -do - eval record=\$$x # Get the prompt record - IFS=$DL # Get individual fields - read prompt default answers <