#!/bin/bash i=1 while : ; do n=$( 1230099.pl | wc -l ) (( n == 15 )) || break printf '%d\r' $((i++)) done echo "$i:$n"