The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 12-06-2005
djt0506 djt0506 is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 5
simple shell script problem

hi all. i have a little problem. im basically reading input from the user from the keyboard into the variable "phonenumber". I want to do a little error check to check if the user doesnt enter anything in for the value phonenumber.

i had this:

read phonenumber

if [ $phonenumber=" " ]
then
.....
else
.....
fi

but thatjust performs then instructions in between "then" and "else", but not "else" and "fi". any ideas?

thanks all in advance for your help.