Microsoft
Software
Hardware
Network
Question : Bash: curl and redirected url
Hi experts,
I know that
status=$(curl -s --head "$URL" | awk '/HTTP/ {print $2})
gives http code such as "200" or "404" Assume that the code is "310" ("moved permanently"), then how to use "curl" to retrieve the new url?
I googled but I got no answers.
Thanks for any replies.
Answer : Bash: curl and redirected url
NewURL=$(curl -s --head "$URL" | awk '/Location:/ {print $2}')
Random Solutions
Can't connect to Exchange over VPN connection
automating ssh using expect
Why does running Dual Monitor break my C# Video Application?
To covert an access report with pictures to any editable document format retaining all the graphics and other formatting settings
Sale, Authorization, or Order?
How to recreate default user profile
Vlookup values in a column to the left of the matched cell
ghost image
How can I get rid of the VISTA WELCOME SCREEN and get a normal DOMAIN Log In like Windows XP?
Limit mail delivery to users