dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

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