title: How to transform case-sensitive script meant to list duplicate files to case-insensitive?
body: <p>This script will list all the files with same filenames even when they are in different (sub)directories or have different file extensions (or no extension at all):</p>
  
  <pre><code>declare -A array=() dupes=()
  while IFS= read -r -d '' file; do 
      base=${file##*/} base=${base%.*}
      if [[ ${array[$base]} ]]; then 
          dupes[$base]+=" $file"
      else
          array[$base]=$file
      fi
  done &lt; &lt;(find /the/dir -type f -print0)
  
  for key in "${!dupes[@]}"; do 
      echo "$key: ${array[$key]}${dupes[$key]}"
  done
  </code></pre>
  
  <p>(<a href="https://askubuntu.com/questions/48524/search-for-duplicate-file-names-within-folder-hierarchy/48549#48549">source</a>)</p>
  
  <p>I want to do exactly the same but also list files with the same filenames in different case. That means where all these files would be listed as duplicates:</p>
  
  <pre><code>/the/dir/file.txt
  /the/dir/folder1/File
  /the/dir/folder2/filE.JPG
  </code></pre>