Help again!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help again!
# 1  
Old 04-05-2005
Help again!

Is there anything wrong with this part of my codes? Am I not using the while loop correctly here? It keeps giving me an error with the 3rd line in bold.

I want the loop to run 10 times.. so I put in counter to decrease each time the loop runs. But the problem is the while statement itself. Isn't it put in the proper format??

Thanks in advance

counter=1
max=10
while ["$counter" != "$max"]
do
other codes....
other codes....
other codes....
counter="$counter"+1
sleep 10
done

this is the error that I get by the way: ./monitorUsers.sh: line 3: [1: command not found

I'm using Bash shell!
# 2  
Old 04-05-2005
Spaces are required. Change this line while ["$counter" != "$max"] to while [ "$counter" != "$max" ]
# 3  
Old 04-05-2005
Worked! thanks!!! Smilie
Login or Register to Ask a Question

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