📄 0224-0226.html
字号:
<HTML>
<HEAD>
<TITLE>Sams Teach Yourself Linux in 24 Hours:Text Processing:EarthWeb Inc.-</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=0672311623 //-->
<!-- TITLE=Sams Teach Yourself Linux in 24 Hours//-->
<!-- AUTHOR=Bill Ball//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=14 //-->
<!-- PAGES=0211-0228 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0221-0223.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0227-0228.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-224"><P>Page 224</P></A>
<P>example, the sample license document uses the phrase
this Package to describe a software package. If you're the software developer of a new game,
Nano-Warrior, and need to save time writing copyright licenses, you can change all occurrences of
this Package to Nano-Warrior easily and quickly without using a text editor:
</P>
<!-- CODE //-->
<PRE>
# cat LICENSE | sed `s/this Package/Nano-Warrior(TM)/g'
...
1. You may make and give away verbatim copies of the source form of the
Standard Version of Nano-Warrior(TM) without restriction, provided that you
duplicate all of the original copyright notices and associated
disclaimers.
...
</PRE>
<!-- END CODE //-->
<P>The sed s, or substitute command, is used to search for all instances of the first string,
and to replace each instance with the second because of the
g, or global, command. The original text file is not changed, and you can save a new version by redirecting the output.
<P>
<P>The sed command also is designed to work using editing scripts. To make
numerous, regular changes to files, create an editing script and use your script to edit files. Use
the sed command's -f, or script file command-line option to use the script:
</P>
<!-- CODE SNIP //-->
<PRE>
# sed -f myscipt.sed < form.ltr >output.ltr
</PRE>
<!-- END CODE SNIP //-->
<TABLE BGCOLOR=#FFFF99><TR><TD>JUST A MINUTE</TD></TR><TR><TD>
<BLOCKQUOTE>
There are too many text filters included with your Linux distribution to
discuss in this hour; see the manual pages for the filter commands listed near
the beginning of this section. You also may want to experiment with the wc, or
word count, program, which reports the number of characters, words, and lines
in your text documents.
</BLOCKQUOTE></TD></TR></TABLE>
<H4><A NAME="ch14_ 11">
Applix Words
</A></H4>
<P>There are many other Linux word processing programs besides the text editors
installed on your system. These programs may be in the public domain, distributed as
shareware, or sold commercially. One word processor, Applix Words by Applix, Inc., sold by Red
Hat Software, deserves special mention because it
</P>
<UL>
<LI> Is an integrated part of the Applixware suite of office tools, and includes
a spreadsheet, graphics, mail, and presentation program, and supports
frames, linked objects, and pasted graphics
<LI> Provides a WYSIWYG view of your documents, and comes
with two dozen fonts
<LI> Imports and exports 20 different word processing file formats
<LI> Supports extensive editing macros
<LI> Includes a spelling dictionary and thesaurus<BR>
</UL>
<A NAME="PAGENUM-225"><P>Page 225</P></A>
<UL>
<LI> Includes extensive built-in and context-sensitive help
<LI> Creates and edits hypertext markup language, or HTML documents
<LI> May be completely customized with new menus or keyboard commands
<LI> Builds indexes, tables, tables of contents, and glossaries
<LI> Was used to write this book!
</UL>
<P>Applix Words requires the X Window System (see Figure 14.6). The Applixware
suite needs about 135 megabytes of your hard drive space, and 16 megabytes of your
computer's memory to run comfortably. Once installed, run Applix Words with the following:
</P>
<P>Figure 14.6.<BR>
The Applix Words <br>
program from Applix, <br>
Inc. is part of Red Hat <br>
Software's Applixware<BR>
suite of office tools <br>
and is a WYSIWYG <br>
word processor with <br>
many different features, <br>
including a <br>
customizable interface <br>
and professional <br>
editing tools for <br>
writers.</P>
<P><a href="javascript:displayWindow('images/ch14fg06.jpg', 288, 216)"><img src="images/tn_ch14fg06.jpg"></a><BR>
</P>
<!-- CODE SNIP //-->
<PRE>
# applix -wp
</PRE>
<!-- END CODE SNIP //-->
<P>This command line starts the word processor. Applix Words also has a tutorial, like
emacs. To start learning, select the Help menu, and then pull down the Tutorial menu item
(you also can hold down the Alt key, then press h, followed by the t key).
</P>
<P>Find out more about Applix Words by browsing to the following site:
</P>
<!-- CODE SNIP //-->
<PRE>
<a href="http://www.redhat.com">
http://www.redhat.com</A>
</PRE>
<!-- END CODE SNIP //-->
<H3><A NAME="ch14_ 12">
Spell Checking Your Documents
</A></H3>
<P>Misspelled words in your documents can be embarrassing, especially if other people
read your text. Correct spelling is an important part of writing and word processing. Just
as
</P>
<A NAME="PAGENUM-226"><P>Page 226</P></A>
<P>errors in syntax can cause programming errors, spelling errors can cause problems
in miscommunication, and loss of a potential job, customer, or the respect of a supervisor.
</P>
<P>Fortunately, your Linux distribution comes with the ispell spelling checker, so you
won't have to suffer the embarrassment of misspelling! This section shows you how to
correct documents and fix your spelling errors.
</P>
<H4><A NAME="ch14_ 13">
Correcting Documents with the ispell Command
</A></H4>
<P>The ispell command, found under the /usr/bin directory, is an interactive spelling
program you can use alone or with your text editor to correct spelling mistakes. Several
editors included with your Linux distribution, such as emacs and pico, are set up to
automatically use this program for spell checking, but using
ispell by itself is easy. For example, to check the spelling of the file
myfile.txt, use
</P>
<!-- CODE SNIP //-->
<PRE>
# ispell myfile.txt
</PRE>
<!-- END CODE SNIP //-->
<P>The ispell program loads the text, and then displays the first found error in context,
along with a single or several suggested replacements:
</P>
<!-- CODE //-->
<PRE>
MERCHANTIBILITY File: LICENSE
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
0: MERCHANTABILITY
[SP] <number> R)epl A)ccept I)nsert L)ookup U)ncap Q)uit e(X)it or ? for help
</PRE>
<!-- END CODE //-->
<P>Correct the spelling by either typing 0, the number of the suggested replacement word,
or R, to replace the word by retyping it. Look up other words with
L, the lookup command, which searches the system dictionary, called words, located under the
/usr/dict directory. If you use the I, or insert command, ispell creates a personal dictionary in your
home directory, using .ispell_english as a filename.
</P>
<P>You also can specify multiple documents on the ispell command line:
</P>
<!-- CODE SNIP //-->
<PRE>
# ispell *.txt
</PRE>
<!-- END CODE SNIP //-->
<P>This command line causes ispell to load each file ending in
.txt for spell checking. If you'd prefer to use ispell as the more traditional UNIX spell command, which reads a
document then prints out a list of suspected words, use
ispell's -l, or list option, on the command line:
</P>
<!-- CODE //-->
<PRE>
# ispell -l < LICENSE
...
Julianne
Haugh
uunet
uu
MERCHANTIBILITY
...
</PRE>
<!-- END CODE //-->
<P><CENTER>
<a href="0221-0223.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0227-0228.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -