how to proceed when curl is finished

view story

http://www.unix.com – I have a script which uses cli curl to download the source code of a webpage and then tests if a specific string exists in the source. The problem is that the website has a slow response, so the eval expression hasn't completed when the test starts. The test returns a negative, and the curl completes right after the test and changes the source.html. The test should have been positive, but ran too soon. How do I make the test wait until curl has finished? Do I have to sleep for a few seconds, or is there another way? Code: string=$(echo "curl -d "'"'$datastring'"'&q (HowTos)