title: shell script wget not working when used as a cron job
body: <p>i have a function in a php web app that needs to get periodically called by a cron job.  originally i just did a simple wget to the url to call the function and everything worked fine, but ever since we added user auth i am having trouble getting it to work.</p>
  
  <p>if i manually execute these commands i can login, get the cookie and then access the correct url: </p>
  
  <pre><code>site=http://some.site/login/in/here
  cookie=`wget --post-data 'username=testuser&amp;password=testpassword' $site -q -S -O /dev/null 2&gt;&amp;1 | awk '/Set-Cookie/{print $2}' | awk 'NR==2{print}'`
  wget -O /dev/null --header="Cookie: $cookie" http://some.site/call/this/function
  </code></pre>
  
  <p>but when executed as a script, either manually or through cron, it doesn't work.</p>
  
  <p>i am new to shell scripting, any help would be appreciated</p>
  
  <p>this is being run on ubuntu server 10.04</p>