| | #!/bin/sh |
---|
| | # tpromptuser.sh - User Prompting From Shell With validation |
---|
| | # Copyright (c) 2010, TundraWare Inc, Des Plaines, IL USA |
---|
| | # All Rights Reserved |
---|
| | # $Id: tpromptuser.sh,v 1.108 2010/10/07 22:35:01 tundra Exp $ |
---|
| | # $Id: tpromptuser.sh,v 1.109 2012/06/05 19:28:05 tundra Exp $ |
---|
| | |
---|
| | ##### |
---|
| | # You are hereby granted a non-exclusive license to do whatever you |
---|
| | # like with this software so long as you understand this is |
---|
| |
---|
| | done |
---|
| | |
---|
| | if [ _$DONE = _False ] |
---|
| | then |
---|
| | echo "Invalid Response! Must Be One Of: $answers" |
---|
| | printf "Invalid Response! Must Be One Of: $answers\n" |
---|
| | fi |
---|
| | fi |
---|
| | |
---|
| | done |
---|
| |
---|
| | PROMPTLIST="foo bar baz bat" |
---|
| | |
---|
| | # Display the records for purposes of this example only |
---|
| | |
---|
| | echo "Before: foo->$foo bar->$bar baz->$baz bat->$bat" |
---|
| | printf "Before: foo->$foo bar->$bar baz->$baz bat->$bat\n" |
---|
| | |
---|
| | |
---|
| | # Go get the user input and validate it |
---|
| | |
---|
| |
---|
| | |
---|
| | |
---|
| | # Dump results for sake of this example only |
---|
| | |
---|
| | echo "After: foo->$foo bar->$bar baz->$baz bat->$bat" |
---|
| | printf "After: foo->$foo bar->$bar baz->$baz bat->$bat\n" |
---|
| | |
---|
| | |
---|
| | |