Created
May 3, 2014 08:36
-
-
Save nsisodiya/e0d7f52918a167f5bb8f to your computer and use it in GitHub Desktop.
This will be helpful in listing all double quoted strings from your js files. It will list strings which has more then 5 spaces
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 | |
find src -name "*.js" | grep -v src/external | while read i | |
do | |
awk -F \" ' | |
{ | |
sep="" | |
for (i=2; i<=NF; i+=2) { | |
printf "%s\"%s\"", sep, $i | |
sep="\n" | |
} | |
print "" | |
} | |
' $i | sed '/^$/d' | while read w | |
do | |
spaces=`echo "$w" | sed 's/\s\+/\n/g'| wc -l` | |
if [ "$spaces" -gt 5 ] | |
then | |
echo $w | |
fi | |
done | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment