I want to fetch some apis from github.
so this is the code
array=(link1 link2 link3 link4)
readarray -t item < <(for i in ${array[@]}
do curl -s "$i" | jq '.tag_name'
done)
and then I can fetch the data from the item.
But the problem is if there is some links left to fetch, curl just stuck there.
I want it to exit immediately and instead of previous data, I need it to print some text like "error" or get its exitcode so that I can implement some logic in case of any fail.
provide a efficient solution for this.