- 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 -
@eabase
Why use BOTH "curl" and "wget". They both do the same thing, but few development environments have both.
"awk" with a field separator of the double quote is a nice solution, and works to pull out the specific architecture required. "sed", "grep", or many of the other general tools can also do the job.
But... I have said before, the final solution generally depends of the specific repo, the environments that is running the code to pull the latest release required. There is no one answer, which is what makes this discussion so interesting.