#!/bin/bash

# Loop through all directories in the current folder
for dir in */; do
    cd "$dir" || continue  # Enter the directory

    # Find and rename incorrect filenames
    for file in *; do
        # Replace fancy apostrophes (’ → ')
        new_name=$(echo "$file" | sed "s/’/'/g")

        # Rename if there's a difference
        if [[ "$file" != "$new_name" ]]; then
            mv "$file" "$new_name"
            echo "Renamed: $file → $new_name"
        fi
    done

    cd ..  # Move back to parent directory
done

echo "Fixing complete!"
