OSDN Git Service

Modified to work with Mac. Apparently the | operator doesn't work in sed.
authorMichael Chan <mchan@android.com>
Fri, 19 Feb 2010 23:32:44 +0000 (15:32 -0800)
committerMichael Chan <mchan@android.com>
Fri, 19 Feb 2010 23:48:08 +0000 (15:48 -0800)
Change-Id: I4d29f7f13e08b8daacc2aeb661774d4ba23ec2d1

tools/findunused/findunusedstrings

index 7057527..9615abc 100755 (executable)
@@ -28,7 +28,8 @@ do
     if [ -d $app/res ]
     then
         pushd $app > /dev/null
-        for i in $(grep -Rs "\(string\|plurals\) name=" res | sed 's/.*<\(string\|plurals\) name="//'|sed 's/".*$//'|sort -u)
+        # Two sed's were needed because the | operator is not supported on the mac
+        for i in $(grep -Rs "\(string\|plurals\) name=" res | sed 's/.*string name=\"//' | sed 's/.*plurals name=\"//'|sed 's/".*$//'|sort -u)
         do
             echo $i $(grep -Rws R.plurals.$i\\\|R.string.$i\\\|@string/$i .|wc -l)
         done | grep ' 0$' | {