Skip to content

Instantly share code, notes, and snippets.

@eral
Created May 12, 2025 14:41
Show Gist options
  • Save eral/e839c94cd5cb0a3723032dd95031ed07 to your computer and use it in GitHub Desktop.
Save eral/e839c94cd5cb0a3723032dd95031ed07 to your computer and use it in GitHub Desktop.
trace redirect with curl
@echo off
pushd "%~dp0"
wsl "./%~n0.sh" %*
popd
URL=$1
while [[ "${URL}" != "" ]] ;do
echo "${URL}"
URL=$(curl -w "%{redirect_url}\n" -s -o /dev/null "${URL}")
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment