6b3901fa ^
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/bash for MAP in maps/*.tmx do grep '<tileset\|<image' "$MAP" | while read TILESET && read IMAGE do LINE=$TILESET TILESET=${TILESET#*name=\"} TILESET=${TILESET%%\"*} IMAGE=${IMAGE#*source=\"} IMAGE=${IMAGE%%.png\"*} IMAGE=${IMAGE##*/} sed "/$LINE/s/$TILESET/$IMAGE/" -i "$MAP" done done