for d in "${difficulties[@]}"; do
for t in "${step_types[@]}"; do
xmlstarletcmd="$xmlstarletcmd -o \"NEWLIST:$person:$t:$d\" -n \
- -v '//SongScores//Song[starts-with(@Dir, \"Songs/$persons_folder\")]//Steps[@Difficulty=\"$d\" and @StepsType=\"$t\"]//HighScore[1]//Name[text()=\"EVNT\" or text()=\"$me_highscore_name\"]/following-sibling::PercentDP' \
+ -v \"//SongScores//Song[starts-with(@Dir, \\\"Songs/$persons_folder\\\")]//Steps[@Difficulty=\\\"$d\\\" and @StepsType=\\\"$t\\\"]//HighScore[1]//Name[text()=\\\"EVNT\\\" or text()=\\\"$me_highscore_name\\\"]/following-sibling::PercentDP\" \
-n -o \"SONGS\" -n \
- -v '//SongScores//Song[starts-with(@Dir, \"Songs/$persons_folder\")]//Steps[@Difficulty=\"$d\" and @StepsType=\"$t\"]//HighScore[1]//Name[text()=\"EVNT\" or text()=\"$me_highscore_name\"]/ancestor::Song/@Dir'"
+ -v \"//SongScores//Song[starts-with(@Dir, \\\"Songs/$persons_folder\\\")]//Steps[@Difficulty=\\\"$d\\\" and @StepsType=\\\"$t\\\"]//HighScore[1]//Name[text()=\\\"EVNT\\\" or text()=\\\"$me_highscore_name\\\"]/ancestor::Song/@Dir\""
done
done
done < <(find "${DIR}"/*.favourites.txt -type f -print0)
- scores_and_shit=$(eval "xmlstarlet sel -t $xmlstarletcmd -n -o \"NEWLIST\" ${path_to_stats}")
+ scores_and_shit=$(eval "xmlstarlet sel -t $xmlstarletcmd -n -o \"NEWLIST\" \"${path_to_stats}\"")
IFS=$'\n' read -rd '' -a scores_list <<<"$scores_and_shit"
echo "$me_highscore_name" > "${DIR}/$me.scores.txt"