Skip to content

Instantly share code, notes, and snippets.

@emreerkan
Last active March 16, 2025 16:42
Show Gist options
  • Select an option

  • Save emreerkan/f927e4f2c5679bba51367b3134d68284 to your computer and use it in GitHub Desktop.

Select an option

Save emreerkan/f927e4f2c5679bba51367b3134d68284 to your computer and use it in GitHub Desktop.
HumbeBundle Dragonlance file renamer
#!/bin/bash
declare -a books=(
"01-dragonsofautumntwilight.epub"
"02-dragonsofwinternight.epub"
"03-dragonsofspringdawning.epub"
"04-timeofthetwins.epub"
"05-warofthetwins.epub"
"06-testofthetwins.epub"
"07-soulforge.epub"
"08-brothersinarms.epub"
"09-dragonsofsummerflame.epub"
"10-dragonsofafallensun.epub"
"11-dragonsofaloststar.epub"
"12-dragonsofavanishedmoon.epub"
"13-amberandashes.epub"
"14-amberandiron.epub"
"15-amberandblood.epub"
"16-dragonsofthedwarvendepths.epub"
"17-dragonsofthehighlordskies.epub"
"18-dragonsofthehourglassmage.epub"
"19-thelegendofhuma.epub"
"20-kaztheminotaur.epub"
"21-weaselsluck.epub"
"22-galenbeknighted.epub"
"23-darknessandlight.epub"
"24-kendermore.epub"
"25-brothersmajere.epub"
"26-gatesofthorbardin.epub"
)
declare -a original_files=(
"dragonsofautumntwilight.epub"
"dragonsofwinternight.epub"
"dragonsofspringdawning.epub"
"timeofthetwins.epub"
"warofthetwins.epub"
"testofthetwins.epub"
"soulforge.epub"
"brothersinarms.epub"
"dragonsofsummerflame.epub"
"dragonsofafallensun.epub"
"dragonsofaloststar.epub"
"dragonsofavanishedmoon.epub"
"amberandashes.epub"
"amberandiron.epub"
"amberandblood.epub"
"dragonsofthedwarvendepths.epub"
"dragonsofthehighlordskies.epub"
"dragonsofthehourglassmage.epub"
"thelegendofhuma.epub"
"kaztheminotaur.epub"
"weaselsluck.epub"
"galenbeknighted.epub"
"darknessandlight.epub"
"kendermore.epub"
"brothersmajere.epub"
"gatesofthorbardin.epub"
)
for i in "${!original_files[@]}"; do
if [ -f "${original_files[$i]}" ]; then
mv "${original_files[$i]}" "${books[$i]}"
fi
done
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment