case statements

i need to use a case statement to do something when the user enters nothing at the prompt.

i know about the if statement and that isnt' what i'm interested in using for this. i want to use case.

heres the scenerio. a program asks a user for an input. i want to use a case statement to check the variable to see if the user entered something or just simply pressed enter. if the user had just pressed ENTER the variable will of course be empty. so i want case to do something if this variable is empty.

i already tried this but it didn't seem to work:

case $yaga in
*)
....
.....

Try this. Worked in Sun 5.8.

#!/bin/sh
read yaga
case $yaga in
a)      echo "printed an a";;
b)      echo "printed a b!";;
"")     echo "entered nothing";;
*)      echo "something else";;
esac