How to use counter to run the script to limit number?

view full story

http://www.unix.com – I want to run my shell script to the limit number.Suppose I know in advance that MAX=5 then I want that my script run 5 times only.Something like below Code: [st@VHLD rohit]$ vi testingMAX=5COMMAND="ssh -l stpuser VHLDVWSAD001 /projects/st/utils/deploy/deployall.sh >/dev/null 2>&1 &" ; sleep 20;count=0while [ $count -le $MAX ]docount=`expr $count + 1`echo `COMMAND`done Can someone help me how could I use counter here? ---------- Post updated 04-29-12 at 02:13 AM ---------- Previous update was 04-28-12 at 10:13 PM ---------- Can someone help me to correct (HowTos)