Created
December 18, 2012 19:06
-
-
Save charles-dyfis-net/4330922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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