Skip to content

Instantly share code, notes, and snippets.

@ushios
Created September 25, 2017 09:31
Show Gist options
  • Save ushios/85b9de85b42bedffc0a86e28837011a3 to your computer and use it in GitHub Desktop.
Save ushios/85b9de85b42bedffc0a86e28837011a3 to your computer and use it in GitHub Desktop.
Download json with format in bash.
#!/bin/bash
list=(
"http://example.com/where.json"
"http://example.com/some.json"
)
function download() {
for i in $@; do
file="./${dir}/$(basename ${i})"
curl "${i} | jq "." > ${file}
done
}
download ${list[@]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment