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.
Asked
Active
Viewed 1,801 times
1 Answers
4
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/

ccm
- 356
- 2
- 7