wget command not found in hp-ux box, looking for alternative

1.9k views Asked by At

I am using hp-ux box and want to use wget to test a url is up or down. I am getting an error wget not found, samething happened with curl command. please suggest what can i use instead of wget and curl.

1

There are 1 answers

0
ccm On

If you have perl installed with the libwww-perl distribution, you may have the lwp-request program. Usage is simple:

lwp-request http://acme.tld/

For scripting, the exit status will be zero if the URL is good and non-zero if it's bad. If you don't care about the output, just pipe it to /dev/null:

if lwp-request $url >/dev/null
then
    echo "URL is good"
else
    echo "URL is bad"
fi

To avoid having to actually download the file at the URL, you can have lwp-request use the HEAD method like this:

lwp-request -mHEAD http://acme.tld/