From 8d014167ecb6b3d5e85f4945cae2256e0ddbf758 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Fri, 19 Feb 2010 15:32:44 -0800 Subject: [PATCH] Modified to work with Mac. Apparently the | operator doesn't work in sed. Change-Id: I4d29f7f13e08b8daacc2aeb661774d4ba23ec2d1 --- tools/findunused/findunusedstrings | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/findunused/findunusedstrings b/tools/findunused/findunusedstrings index 70575272..9615abcc 100755 --- a/tools/findunused/findunusedstrings +++ b/tools/findunused/findunusedstrings @@ -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$' | { -- 2.11.0