Yes. $DZEN_Y is calculated prior to that test. It defaults based on screen resolution plus a user-defined padding value. The bottom of the stack (first wget instance) is at the bottom right of the screen. Here is the debug output of the 3rd instance of the script (so DZEN_Y should be 686):
Code:
if [[ $CNT -gt 0 ]]; then
while read y; do
if [[ $DZEN_Y -eq $y ]]; then
DZEN_Y=$(( $y - $DZEN_H ))
else
echo "$DZEN_Y" >> "$COORDS"
break
fi
done < "$COORDS"
else
DZEN_Y=$((738-($CNT*26)))
echo "$DZEN_Y" >> "$COORDS"
fi
+ [[ 2 -gt 0 ]]
+ read y
+ [[ 738 -eq 738 ]]
+ DZEN_Y=712
+ read y
I'm not sure why the 738 is properly appended to $COORDS whereas the 712 is not. Thus, all subsequent instances are stacked atop one another at y=712.
Catkin: -le would not work in this case because it would return true even if the y-coord is available. I would like the loop to break if an increment of 26 is found that is less than the values pulled from $COORDS.
Thanks for you input guys.