Created
September 25, 2017 09:31
-
-
Save ushios/85b9de85b42bedffc0a86e28837011a3 to your computer and use it in GitHub Desktop.
Download json with format in bash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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