- 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 -
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
unamemagic and all your users are good to go.