The syntax of the while command is
while list1
do list2
done
qsh runs the two lists repeatedly while the exit status of list1 is zero. When the exit status of list1 is non-zero the command completes.
Examples
max=100 index=0 while [[ $index -lt $max ]] ; do echo Index is $index let index+=1 done