Skip to content

Instantly share code, notes, and snippets.

@tlayh
Created April 30, 2014 15:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlayh/11430826 to your computer and use it in GitHub Desktop.
Save tlayh/11430826 to your computer and use it in GitHub Desktop.
Shell script to find unused xliff ids in your project. ./searchIds.sh Packages/Applications/My.Package
#!/bin/bash
files=$( find $1 -name "*xlf" )
for file in $files; do
list=$(cat $file | grep "id=" | cut -d '"' -f2)
for i in `echo $list`; do
found=$(grep --exclude="*xlf" -R $i *);
if [ -z "${found}" ]; then echo "$i not used"; fi;
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment