Skip to content

Instantly share code, notes, and snippets.

@Daij-Djan
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daij-Djan/a4222585f33d21865373 to your computer and use it in GitHub Desktop.
Save Daij-Djan/a4222585f33d21865373 to your computer and use it in GitHub Desktop.
find duplicate strings file entries (duplicate keys! the value can differ)
#!/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"
#!/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