9 ms·
To save the grep, you can do: sed -Ene 's/^location: (.*)?utm.*$/\1/p' If you've got a newer `curl`, you can just print the header: curl -I -s -o /de
by zimpenfish 2y ago
To save the grep, you can do:
sed -Ene 's/^location: (.*)?utm.*$/\1/p'
If you've got a newer `curl`, you can just print the header:
curl -I -s -o /dev/null -w '%header{location}' <url>
But you'll obviously still need the sed if you want to trim off the UTM cruft. Unless you want to go the route of `bash` substitutions.
l="$(curl -I -s -o /dev/null -w '%header{location}' <url>)"
echo "${l%%?utm*}"
- trollied 2y agoThis thread is a virtual UA meet
- zimpenfish 2y agoOh no!
- easterncalculus 2y agoSorry, what is UA?
- mitchbob 2y agohttps://www.underearnersanonymous.org/meetings-underearners-anonymous/ https://www.underearnersanonymous.org/meetings-underearners-...
- porridgeraisin 2y agoI'll do one better eval `llm "bash script to get 5 random links from indieblogs and print one on each line"` You could say it's a self mutating program.