Microsoft
Software
Hardware
Network
Question : Curl: how to get httpcode in Bash
Hi experts,
I know that I can use
curl -o $WEBSITEID "$URL"
to retrieve data from a url, however how to check if the retrieval is successful or not? In other words, how to get the response code (such as "200", or "404")?
Thanks for your replies.
Answer : Curl: how to get httpcode in Bash
1:
status=$(curl -s --head "$URL" | awk '/HTTP/ {print $2})
Open in New Window
Select All
Random Solutions
Exchange 2003 no inbound and local delivery
Fade in/out, side-to-side movement and scaling of images in rotating photo gallery using Actionscript
How do I force pc's in one site to hit a specific domain controller
After changing TCP/IP settings (IP from other IP range) windows firewall has switched the active profile from domain to standard. WHY ?
array, init, qw - how to include empty string
What's netmask ?
Filter Report Based On Multiple Dynamic Combo boxes
Google earth unable to identify graphics card
Kernel update broke NVIDIA driver
Powershell Script script cannot fit the colums into the display and were removed