Created
June 10, 2021 21:01
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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