- Use
curlto get the JSON response for the latest release - Use
grepto find the line containing file URL - Use
cutandtrto extract the URL - Use
wgetto download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
That would be another topic, on another thread: "how do I download an artifact if the filename doesn't change."
The case we are discussing is very clear and it's pretty different.
And it's really unimportant if you use
sed,grep,jq, because everything woks. Maybe one pipe should be enough, but if you are not seeking for extreme optimization, it's purely stylistic.For instance I rather like the AWK approach:
again, we are hundreds of people, not having much else todo, and playing to find different solutions, but we're not hundreds of idiots. This thread is 8 year old and if there was a simpler solution someone else would have found it in 8 years.