J. Bakshi wrote: > cap_string=`cat index.php | grep src=\"captcha.phtml | cut -f 10 -d '"'`
Search the web for "useless use of cat" and read all about it. Don't use cat piped to grep here. Simply use grep. Plus I recommend getting in the habit of using $(...) instead of `...`. cap_string=$(grep src=\"captcha.phtml index.php | cut -f 10 -d '"') > wget http://192.168.1.108/$cap_string -O /tmp/captcha.png > wget --post-date 'username=xxx&password=xxx&captcha_code=<retrieved_code>' > http://192.168.1.108 The site is almost certainly using session cookies to create a virtual connection. Read the wget man page for the cookies options. Basically something like this: wget --keep-session-cookies --save-cookies=cookies.txt http://192.168.1.108/$cap_string -O /tmp/captcha.png wget --keep-session-cookies --load-cookies=cookies.txt --save-cookies=cookies.txt --post-date 'username=xxx&password=xxx&captcha_code=<retrieved_code>' http://192.168.1.108 That should tell wget to save the session cookies to the file and then with the next invocation will load those session cookies and send them back to the site. This should enable the separate wget invocations to appear as a single session client to the remote web site. Bob
signature.asc
Description: Digital signature