-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathack.html
53 lines (48 loc) · 2.77 KB
/
ack.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Pod::Advent 0.18 (Pod::Simple 3.07, Perl::Tidy 20071205) on 2009-12-06 08:08:46 -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>2009 CN Perl Advent Calendar: ack</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
<link rel="alternate" type="text/plain" href="ack.pod" />
</head>
<body>
<h1><a href="index.html">CN Perl Advent Calendar 2009-12</a>-06</h1>
<h2 align="center">ack</h2>
<h3 align="center">by Fayland Lam</h3>
<p><a href="ack">ack</a> 类似 grep, 能做 99% grep 做的事情。</p>
<pre><span class="c">[fayland@perl .cpan]$ ack --perl XXX .
build/Config-INI-MVP-0.024-ntIMhU/inc/Module/Install/Makefile.pm
241: # XXX - This is currently unused; not sure if it breaks other MM-users
build/Config-INI-MVP-0.024-ntIMhU/lib/Config/INI/MVP/Reader.pm
96:# XXX: These should be attributes with builders and blah blah blah, but I just
build/Pod-Weaver-3.093130-CWMqF_/lib/Pod/Weaver/Plugin/EnsurePod5.pm
18: # XXX: This is really stupid. -- rjbs, 2009-10-24
build/Pod-Weaver-3.093130-CWMqF_/t/ini-config.t
80:# XXX: This test is extremely risky as things change upstream.
build/Pod-Weaver-3.093130-CWMqF_/t/basic.t
80:# XXX: This test is extremely risky as things change upstream.
build/Email-Sender-0.093110-x5M__z/lib/Email/Sender/Transport/Test.pm
72: # XXX: We must report partial success (failures) if applicable.</span></pre>
<p><a href="http://betterthangrep.com/">http://betterthangrep.com/</a></p>
<p>十大理由使用 ack:</p>
<p>* 快速。比 grep 快多了</p>
<p>* 使用 Perl 编写</p>
<p>* 能在 Windows 下运行</p>
<p>* 默认忽略您不要的东西。比如 .svn .git 目录,vim 的临时文件等。</p>
<p>* 支持文件类型,比如 --perl 或者 --nohtml 等,无需 find -type</p>
<p>* 可以得到某种类型文件的列表,比如得到 perl 文件的列表</p>
<pre><span class="c">$ ack -f --perl > all-perl-files</span></pre>
<p>* 语法加亮。</p>
<p>* 使用我们最熟悉的 Perl 正则</p>
<p>* 支持大部分 grep 参数如 -w -c -l</p>
<p>* ack 只有三个字符,grep 有四个,而 grep -r 是六个。</p>
<p>最后,它能合并到流行的编辑器中,如 Vim, Emacs 和 TextMate. 参考 <a href="http://search.cpan.org/perldoc?ack#ACK_&_OTHER_TOOLS">http://search.cpan.org/perldoc?ack#ACK_&_OTHER_TOOLS</a></p>
<p>而 Perl 编辑器 <a href="Padre">Padre</a> 就是使用 ack 来做文件搜索。</p>
<p>最后,感谢牛人 Andy Lester (petdance) 给我们带来了 ack.</p>
<p>谢谢。</p>
<div style="float: right; font-size: 10pt"><a href="ack.pod">View Source (POD)</a></div><br />
</body>
</html>