- Use
curl
to get the JSON response for the latest release - Use
grep
to find the line containing file URL - Use
cut
andtr
to extract the URL - Use
wget
to 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 -
this is the best solution. thank you @joshjohanning. everything else is unnecessarily complicated for users and could trip them up because of different shell versions and lack of installed libs like
jq
.add in a bit of
uname
magic and all your users are good to go.