Execute a URL through a shell script

Hi,

how can I create a shell script that will execute an http url.

for example I have the following url

http://servername/cgi-bin/dl-cmmgr-mstr.cgi?user=A1&script=LIST+ALL+PROPERTIES+FOR+PROJECT+CONFIGURATION+IN+PROJECT+%22Enterprise+Manager+v8.01%22 

now I need a shell script that will execute this URL , so when I call this shell script from command line or a cron job this url will be run

thanks
-anshu
anshumaEngineeringAsked:
Who is Participating?
 
woolmilkporcConnect With a Mentor Commented:
Have a look at curl
"man curl" or this - http://linux.die.net/man/1/curl
wmp
0
 
TintinConnect With a Mentor Commented:
Just add

wget

or

curl

to the beginning of the URL.   You may want to add some options depending on what you want to do with the output.
0
 
KlaasdezwartConnect With a Mentor Commented:
you can do this with php, and run that from cron

<?
$ch = curl_init();
$postData  = "user=A1&script=LIST+ALL+PROPERTIES+FOR+PROJECT+CONFIGURATION+IN+PROJECT+%22Enterprise+Manager+v8.01%22";
$urlcurl =  "http://servername/cgi-bin/dl-cmmgr-mstr.cgi";

curl_setopt($ch,  CURLOPT_URL, $urlcurl);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_exec($ch);
curl_close($ch);
?>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.