hurlo (297B)
1 #!/bin/sh 2 if [ "$#" -lt 1 ]; then 3 cat 4 else 5 printf '%s\n' "$@" 6 fi | while read -r url; do 7 out="${url##*/}" 8 [ -z "$out" ] && out="hurl_out" 9 [ -e "$out" ] && { printf 'error: %s exists\n' "$out" >&2; return 1; } 10 if ! hurl "$url" > "$out"; then 11 rm "$out" 12 else 13 printf '%s\n' "$out" 14 fi 15 done