find_unused_messages.sh
来自「架設ROSE私服必備之物 ROSE數據庫」· Shell 代码 · 共 32 行
SH
32 行
#!/bin/sh# Simple script to find unused message strings by Michal 膶iha艡tmp1=`mktemp`tmp2=`mktemp`grep -o '\<str[A-Z][a-zA-Z0-9_]*\>' lang/english-iso-8859-1.inc.php \ | grep -Ev '^str(Transformation_|ShowStatus)' | sort -u > $tmp1grep -ho '\<str[A-Z][a-zA-Z0-9_]*\>' `find . -type f -a -name '*.php' -a -not -path '*/lang/*'` \ | grep -Ev '^str(Transformation_|ShowStatus)' | sort -u > $tmp2echo Please note that you need to check results of this script, it doesn\'techo understand PHP, it only tries to find what looks like message name.echoecho Used messages not present in english language file:echo '(this contains generated messages and composed message names, so these'echo 'are not necessary a errors!)'echo# filter out known false positivesdiff $tmp1 $tmp2 | awk '/^>/ {print $2}' | grep -Ev '(strEncto|strXkana|strDBLink|strPrivDesc|strPrivDescProcess|strTableListOptions|strMissingParameter|strAttribute|strDoSelectAll)'echoecho Not used messages present in english language file:echodiff $tmp1 $tmp2 | awk '/^</ {print $2}'rm -f $tmp1 $tmp2
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?