Nice one! I’ve been using a similar approach for curl print location header, but I like how you’ve simplified it. One thing I’d add is using `-L` to follow the redirects automatically. Sometimes the location header isn’t in the first response, so this helps.
For example:
```bash
curl -s -o /dev/null -w "%{redirect_url}" -L http://example.com
```
Also, if you’re dealing with multiple redirects, tools like `httpie` or Postman can visualize the chain better.
For example:
```bash
curl -s -o /dev/null -w "%{redirect_url}" -L http://example.com
```
Also, if you’re dealing with multiple redirects, tools like `httpie` or Postman can visualize the chain better.
