hi all


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting hi all
# 1  
Old 06-02-2008
hi all

i need a help how do i validate that a given field is not blank ie it should not go to the next field when i press enter.

Last edited by din_annauniv; 06-02-2008 at 02:01 AM..
# 2  
Old 06-06-2008
What do you mean by "field"? Something like this?

Code:
while true; do
  echo -n "Input your input: "
  read input
  case $input in "") echo "You lost. Play again";; *) break ;; esac
done

This will loop until the user enters non-blank input.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question