Skip to content

Instantly share code, notes, and snippets.

@charles-dyfis-net
Created December 18, 2012 19:06
Show Gist options
  • Save charles-dyfis-net/4330922 to your computer and use it in GitHub Desktop.
Save charles-dyfis-net/4330922 to your computer and use it in GitHub Desktop.
readarray columns < <(xmlstarlet sel -t -m '//row' -v . -n <<<"$(curl http://sprunge.us/KOGf 2>/dev/null)")
declare -A values
while IFS=' :' read -a words; do
if (( ${#words[@]} < 2 )); then continue; fi
key="${words[0]}"
val="${words[${#words[@]}]}"
values["$key"]="$val"
done < <(curl http://sprunge.us/PCTL 2>/dev/null)
for column in "${columns[@]}"; do
printf '%s ' "${values[$column]}"
done
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment