Skip to content

Instantly share code, notes, and snippets.

@evan
Created March 14, 2024 15:27
Show Gist options
  • Save evan/7dbde3bad09d5efe1bacb4f8c6e9b06b to your computer and use it in GitHub Desktop.
Save evan/7dbde3bad09d5efe1bacb4f8c6e9b06b to your computer and use it in GitHub Desktop.
Convert .CHD to .BIN/.CUE in folders
#!/bin/bash
for chdfile in *.chd; do
if [[ -f "$chdfile" ]]; then
# Extract the base name without the .chd extension
base_name=$(basename "$chdfile" .chd)
# Create a directory for the .bin/.cue files
mkdir -p "$base_name"
# Convert .chd to .bin/.cue
echo "Converting $chdfile to .bin/.cue format..."
chdman extractcd -i "$chdfile" -o "$base_name/$base_name.bin" -ob "$base_name/$base_name.cue"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment