分页: 1 / 1

简单面试题

发表于 : 2008-10-13 16:20
flyinflash
某目录a下有n个文件和子目录,文件里面有(可能没有) x_to_local_lang('x') 字符串。
现在需要把所有文件内的 x 抓出来,合成一个元素唯一性的数组,最后存进文件i18n.txt。

我的思路:
scan file with -r
catch x_to_local_lang('x') as $i18n['en_us'][x], include $__file__, $__line__
shift $i18n['en_us'][x], >> i18n.txt

可是,脚本我竟然写不出来…… :em06 :em06 :em06

Re: 简单面试题

发表于 : 2008-10-13 16:38
oneleaf
grep -r -h -o -E ... . | awk ... | uniq > xxx

Re: 简单面试题

发表于 : 2008-10-13 17:08
Jarson
顶,老大就是强!