#!/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[@]}