I am having this code where it seems that there is a mistake at the while loop. Can someone help me find out what's going on?
accept=0
while [ $accept -eq 0 ]
do
echo "Give a name:"
read name
accept=`java CheckName $name`
done
What I am trying to do is to have a variable "accept" which is initialized with the value 0 (number). While the value of accept is 0 I want to go into the loop and give the user the order "Give a name:" and let the user give a name. After reading the name I call a .java program that checks the name and prints on screen 0 or 1. I want this printed message to be stored in variable "accept". I want the while loop to me executed until the .java program returns 1 which means that the name is accepted.
The shell script seems to have a mistake on to line with the while check statement
while [ $accept -eq 0 ]
The mistake shown on screen is:" [: too many arguments"

New Topic/Question
Reply




MultiQuote




|