📄 0371-0372.html
字号:
<HTML>
<HEAD>
<TITLE>Developer.com - Online Reference Library - 0672311739:RED HAT LINUX 2ND EDITION:GNU Project Utilities</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311739 //-->
<!-- TITLE=RED HAT LINUX 2ND EDITION //-->
<!-- AUTHOR=DAVID PITTS ET AL //-->
<!-- PUBLISHER=MACMILLAN //-->
<!-- IMPRINT=SAMS PUBLISHING //-->
<!-- PUBLICATION DATE=1998 //-->
<!-- CHAPTER=17 //-->
<!-- PAGES=0351-0372 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0368-0370.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="../ch18/0373-0376.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-371"><P>Page 371</P></A>
<TABLE WIDTH="360">
<TR><TD>
blank
</TD><TD>
Horizontal whitespace
</TD></TR>
<TR><TD>
cntrl
</TD><TD>
Control characters
</TD></TR>
<TR><TD>
digit
</TD><TD>
Digits
</TD></TR>
<TR><TD>
graph
</TD><TD>
Printable characters, not including space
</TD></TR>
<TR><TD>
lower
</TD><TD>
Lowercase letters
</TD></TR>
<TR><TD>
print
</TD><TD>
Printable characters, including space
</TD></TR>
<TR><TD>
punct
</TD><TD>
Punctuation characters
</TD></TR>
<TR><TD>
space
</TD><TD>
Horizontal or vertical whitespace
</TD></TR>
<TR><TD>
upper
</TD><TD>
Uppercase letters
</TD></TR>
<TR><TD>
xdigit
</TD><TD>
Hexadecimal digits
</TD></TR>
</TABLE>
<P>The way to invoke tr with one of these character classes is
`[:classname:]'. To get rid of punctuation, use the
punct class:
</P>
<!-- CODE SNIP //-->
<PRE>
tr `[:punct:]' ` ` < ~/docs/ch16.doc |
tr `A-Z' `a-z' | tr -s ` ` | tr -d `\t\n' |
tr ` ` `\n' | sort | uniq -c | sort -rn
</PRE>
<!-- END CODE SNIP //-->
<P>Here's some of the new output:
</P>
<!-- CODE //-->
<PRE>
405 the
170 to
136 a
134 of
122 and
119 is
80 files
74 file
72 in
67 or
</PRE>
<!-- END CODE //-->
<P>The numbers are different for some of the words because I have been running the
commands and writing the chapter at the same time.
</P>
<P>I could also have replaced `A-Z' and `a-z' with the
upper and lower classes, but there is no real advantage to using the classes, and the ranges
are much more illustrative of the process.
</P>
<H3><A NAME="ch17_ 20">
Summary
</A></H3>
<P>This chapter covers the four major GNU utilities packages and the major commands in
each of these packages. As you have seen in the various examples, the real power of these
packages lies in their capability to help the user break down complex tasks and solve them quickly.
</P>
<A NAME="PAGENUM-372"><P>Page 372</P></A>
<P><CENTER>
<a href="0368-0370.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="../ch18/0373-0376.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -