[bash] how is proper way to validate user input

view story

http://www.unix.com – hi all, i have a script that need user input provide all variables that needed to complete a job. this is my current script: Code:     echo "type file source and it full path [e.g: /srv/src/source.csv or "/srv/src dir/my source.csv"]:"     read INPUTFILE     if [ -z $INPUTFILE ] || [ ! -f $INPUTFILE ];     then     echo "ERROR: you didn't enter a file source or file source is not exist."     exit 1     fi       echo "enter directory for output file [e.g: (HowTos)