This file contains hidden or 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
#!/bin/bash | |
# Erase lines between <Mods> and </Mods> excluding the tags | |
sed -i '/<Mods>/,/<\/Mods>/ { /<Mods>/b; /<\/Mods>/b; d; }' mods.xml | |
# Erase lines between <LoadOrder> and </LoadOrder> excluding the tags | |
sed -i '/<LoadOrder>/,/<\/LoadOrder>/ { /<LoadOrder>/b; /<\/LoadOrder>/b; d; }' mods.xml | |
# Find all install.xml files in subfolders, sort them alphabetically based on parent directory's name, and process each one | |
find . -name 'install.xml' | sort -t/ -k2,2 -r | while read -r install_xml; do |