Skip to content

Instantly share code, notes, and snippets.

@hlorand
Created June 10, 2021 21:01
Show Gist options
  • Select an option

  • Save hlorand/4d9c9e5ee03ea56ba9e498693ddb61d6 to your computer and use it in GitHub Desktop.

Select an option

Save hlorand/4d9c9e5ee03ea56ba9e498693ddb61d6 to your computer and use it in GitHub Desktop.
Két mappát hasonlít össze és kigyűjti a különbségeket. Kezeli a két karakterből összerakott ékezetes betűket is
#!/bin/bash
# Ellenőrzi, hogy melyek azok a fájlok amik itt megvannak
# de az otherpath változóban írt helyen nincsenek.
# Én az OSX és Windows Google Driveom tartalmát hasonlítom vele össze.
# Az uconv programot használja az OSX furcsa ékezeteinek
# visszaállítására rendes ékezetekké (e' -> é)
# sudo apt install icu-devtools
# Fura ékezetek neve: NFD normalied accents
# Read more: https://en.wikipedia.org/wiki/Unicode_equivalence#Sources_of_equivalence
# https://cloud.google.com/storage/docs/gsutil/addlhelp/Filenameencodingandinteroperabilityproblems
otherpath='/mnt/d/DRIVE/'
IFSbkp="$IFS"
IFS=$'\n'
for f in $(find . -type f | uconv -x Any-NFC )
do
# Ha nem létezik ez a fájl a másik helyen
if [ ! -f "$otherpath$f" ]; then
echo $f
fi
done
IFS="$IFSbkp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment