fix-windows-names.sh 246 B

12345678910
  1. #!/usr/bin/env bash
  2. mapfile -t files < <(find)
  3. for file in "${files[@]}"; do
  4. [[ $file != *[![:ascii:]]* ]] && continue # check if filename is correct
  5. fixed_name=$(echo "$file" | tr -cd '[:print:]')
  6. mv -v "$file" "$fixed_name"
  7. done