3 ms·
This is what I use which also removes utm_* tracking parameters. getloc () { curl -sI "$1" | grep -i "Location" | awk '/http.*/{print $2}' | sed 's/[%+]
by moehm 7y ago
This is what I use which also removes utm_* tracking parameters.
getloc () {
curl -sI "$1" | grep -i "Location" | awk '/http.*/{print $2}' | sed 's/[%+]*//g' | sed 's/&*utm_[a-zA-Z0-9]*=[a-zA-Z0-9]*//g' | sed 's/?\s*$//g'
}