Last active
August 29, 2015 14:02
-
-
Save Daij-Djan/a4222585f33d21865373 to your computer and use it in GitHub Desktop.
find duplicate strings file entries (duplicate keys! the value can differ)
This file contains 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 | |
FILENAME="Localizable.strings" | |
DUPES=`cut -d' ' -f1 "$FILENAME" | sort | uniq -d` | |
while read -r line; do | |
echo "error: $line used multiple times -" | |
done <<< "$DUPES" |
This file contains 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 | |
c=`expr $SCRIPT_INPUT_FILE_COUNT - 1` | |
for i in $(seq 0 $c) | |
do | |
var="SCRIPT_INPUT_FILE_$i" | |
FILENAME=${!var} | |
DUPES=`cut -d' ' -f1 "$FILENAME" | sort | uniq -d` | |
while read -r line; do | |
if [[ $line == "\""* ]] ; | |
then | |
echo "warning: $line used multiple times -" | |
fi | |
done <<< "$DUPES" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See http://stackoverflow.com/questions/24124530/how-to-find-duplicates-in-localizable-strings-files-automatically/