top | item 40983036

(no title)

qz_kb | 1 year ago

now add error handling.

discuss

order

ryapric|1 year ago

That's really not that hard to add above. A lot of folks act like it's impossible to handle errors etc. in bash, but it's pretty straightforward -- certainly no more difficult than in any other language. The hard part, like with all languages, is deciding how to handle errors cases. The rest is just code.

wiseowise|1 year ago

> That's really not that hard to add above.

Then show how it is going to look like?

cassianoleal|1 year ago

    set -euo pipefail; N=0 while read -r URL; do curl "$URL" | jq '.data[].someProp' | grep -v "filter" > "$N.data" N="$((N+1))" done < ./links.txt