|
发表于 2011-5-28 23:13:04
|
显示全部楼层
根据cscope的手册,-i namefile
Browse through all source files whose names are listed in namefile (file names separated by spaces, tabs, or new-lines) instead of the default (cscope.files). If this option is specified, cscope ignores any files appearing on the command line. The argument namefile can be set to ``-'' to accept a list of files from stdio. Filenames in the namefile that contain whitespace have to be enclosed in "double quotes". Inside such quoted filenames, any double-quote and backslash characters have to be escaped by backslashes.
先把文件名里含有单引号/双引号/斜杠进行转义,然后给文件名加上双引号。
find 句加上- |sed 's/\(["'\''\]\)/\\\1/g;s/^/"/;s/$/"/'
复制代码 改成:
- find `pwd`/ -type f -name "*.h" -o -name "*.py" -o -name "*.xml" -o -name "*.properties" -o -name "*.jsp" -o -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.hpp" -o -name "*.java" -o -name "*.js" |sed 's/\(["'\''\]\)/\\\1/g;s/^/"/;s/$/"/' > ${TARGET}
复制代码 |
|