⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch52_04.htm

📁 the unix power tools
💻 HTM
📖 第 1 页 / 共 5 页
字号:
CLASS="indexterm"NAME="AUTOID-60881"></A>The <EMCLASS="emphasis">catsaway</EM> shell script is included here as an example ofusing a loop to repeat a command until it fails.Article<ACLASS="xref"HREF="ch44_10.htm"TITLE="Loops That Test Exit Status ">44.10</A>.</P></DD><DTCLASS="term">center *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-60889"></A><EMCLASS="emphasis">center</EM> is an <EMCLASS="emphasis">awk</EM> script that centers each line of a file.Article<ACLASS="xref"HREF="ch35_08.htm"TITLE="Centering Lines in a File ">35.8</A>.</P></DD><DTCLASS="term">cgrep *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-60898"></A><EMCLASS="emphasis">cgrep</EM> is a context-<EMCLASS="emphasis">grep</EM> Perl script for showing the givenstring with several lines of surrounding text.Article<ACLASS="xref"HREF="ch27_13.htm"TITLE="More grep-like Programs Written in Perl ">27.13</A>.</P></DD><DTCLASS="term">cgrep.sed *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-60907"></A><EMCLASS="emphasis">cgrep.sed</EM> is a context-<EMCLASS="emphasis">grep</EM> <EMCLASS="emphasis">sed</EM> script for showing the givenstring with several lines of surrounding text.It can also match a pattern that's spread across several lines.Articles<ACLASS="xref"HREF="ch27_11.htm"TITLE="A Multiline Context grep Using sed ">27.11</A>,<ACLASS="xref"HREF="ch34_17.htm"TITLE="Searching for Patterns Split Across Lines ">34.17</A>.</P></DD><DTCLASS="term">checksed *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-60918"></A>The <EMCLASS="emphasis">checksed</EM> shell script runs the <EMCLASS="emphasis">sed</EM> commands in afile called <EMCLASS="emphasis">sedscr</EM> on the specified files, showing the edits with<EMCLASS="emphasis">diff</EM> and a pager program.Article<ACLASS="xref"HREF="ch34_03.htm"TITLE="Testing and Using a sed Script: checksed, runsed ">34.3</A>.</P></DD><DTCLASS="term">chmod_edit *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-60929"></A>The <EMCLASS="emphasis">chmod_edit</EM> shell scriptadds write permission to a file, places you in yourfavorite editor, and then removes write permission again.Article<ACLASS="xref"HREF="ch22_09.htm"TITLE="Protect Important Files: Make Them Unwritable ">22.9</A>.</P></DD><DTCLASS="term">chunksort *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-60937"></A>The <EMCLASS="emphasis">chunksort</EM> script sorts multiline records that areseparated by blank lines.Article<ACLASS="xref"HREF="ch36_07.htm"TITLE="Sorting Multiline Entries ">36.7</A>.</P></DD><DTCLASS="term">cleanup *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-60945"></A><EMCLASS="emphasis">cleanup</EM> is an example of a shell script to be run by <EMCLASS="emphasis">cron</EM>.By combining multiple <EMCLASS="emphasis">find</EM> conditions, the <EMCLASS="emphasis">find</EM> commandis run only once instead of multiple times.  Article<ACLASS="xref"HREF="ch23_22.htm"TITLE="Using find to Clear Out Unneeded Files ">23.22</A>.</P></DD><DTCLASS="term">cleanup.sed *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-60956"></A><EMCLASS="emphasis">cleanup.sed</EM> is a <EMCLASS="emphasis">sed</EM> script to be run on <EMCLASS="emphasis">troff</EM> inputfiles.It converts double quotes to &quot;curly&quot; quotes, two dashes toem-dashes, and places a no-space character before constant-width fontchanges.It should be called with <EMCLASS="emphasis">sed -f cleanup.sed</EM>.Article<ACLASS="xref"HREF="ch43_21.htm"TITLE="Preprocessing troff Input with sed ">43.21</A>.</P></DD><DTCLASS="term">Clear *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-60967"></A><ACLASS="indexterm"NAME="AUTOID-60969"></A><ACLASS="indexterm"NAME="AUTOID-60971"></A><ACLASS="indexterm"NAME="AUTOID-60973"></A><ACLASS="indexterm"NAME="AUTOID-60975"></A><ACLASS="indexterm"NAME="AUTOID-60977"></A><ACLASS="indexterm"NAME="AUTOID-60979"></A><ACLASS="indexterm"NAME="AUTOID-60981"></A>The <EMCLASS="emphasis">Clear</EM> shell script can be used to execute VT100 escapesequences.It is also linked to the names <EMCLASS="emphasis">NOG</EM> (to cancelan alternate character set); <EMCLASS="emphasis">Graphics</EM> (to enable graphics mode);<EMCLASS="emphasis">C132</EM> (to enable 132-column mode); <EMCLASS="emphasis">C80</EM> (to enable 80-columnmode); <EMCLASS="emphasis">Revvid</EM> (to enable reverse video); <EMCLASS="emphasis">Normal</EM> (tore-enable normal video); <EMCLASS="emphasis">ToStatus</EM> (to write a message to theterminal status line); and <EMCLASS="emphasis">ClrStatus</EM> (to clear the status line).Article<ACLASS="xref"HREF="ch41_09.htm"TITLE="Commands to Adjust Your Terminal ">41.9</A>.</P></DD><DTCLASS="term">cls *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-60997"></A><ACLASS="indexterm"NAME="AUTOID-60999"></A><ACLASS="indexterm"NAME="AUTOID-61001"></A><ACLASS="indexterm"NAME="AUTOID-61003"></A><EMCLASS="emphasis">cls</EM> is a compressed directory lister that can list directories in nice columns and indicate &quot;long&quot; names that have been truncated.It is also linked to the names <EMCLASS="emphasis">clf</EM>, <EMCLASS="emphasis">cls2</EM>, and <EMCLASS="emphasis">clf2</EM>.Article<ACLASS="xref"HREF="ch16_06.htm"TITLE='clf, cls: "Compressed&quot; ls Listings'>16.6</A>.</P></DD><DTCLASS="term">cols *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-61014"></A>The <EMCLASS="emphasis">cols</EM> shell script displays output in columns.  It is also linked to the <EMCLASS="emphasis">c2</EM>, <EMCLASS="emphasis">c3</EM>, <EMCLASS="emphasis">c4</EM>, <EMCLASS="emphasis">c5</EM>,<EMCLASS="emphasis">c6</EM>, <EMCLASS="emphasis">c7</EM>, and <EMCLASS="emphasis">c8</EM> commands, to force it to display therespective number of columns.Article<ACLASS="xref"HREF="ch35_16.htm"TITLE="Make Columns Automatically with cols ">35.16</A>.</P></DD><DTCLASS="term">count.it *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-61029"></A><EMCLASS="emphasis">count.it</EM> reports the difference in word length between twofiles.Article<ACLASS="xref"HREF="ch29_06.htm"TITLE="Counting Lines, Words, and Characters: wc ">29.6</A>.</P></DD><DTCLASS="term">count_types *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-61037"></A><EMCLASS="emphasis">count_types</EM> is a shell script that reports the number offiles of each type, as reported by the <EMCLASS="emphasis">file</EM> command.Article<ACLASS="xref"HREF="ch16_24.htm"TITLE="Counting Files by Types ">16.24</A>.</P></DD><DTCLASS="term">cpmod</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-61046"></A><EMCLASS="emphasis">cpmod</EM> allows you to copy modes, ownerships, and times from one file to others, without affecting the data.Article<ACLASS="xref"HREF="ch22_16.htm"TITLE="Copying Permissions with cpmod ">22.16</A>.</P></DD><DTCLASS="term">crontab *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-61054"></A>The <EMCLASS="emphasis">crontab</EM> shell script provides interactive editing of your<EMCLASS="emphasis">crontab</EM> entries.This script is meant for systems thatdo not already provide interactive <EMCLASS="emphasis">crontab</EM> file editing.Article<ACLASS="xref"HREF="ch40_15.htm"TITLE="crontab Script Makes crontab Editing Easier/Safer ">40.15</A>.</P></DD><DTCLASS="term">crush *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-61064"></A><EMCLASS="emphasis">crush</EM> is a <EMCLASS="emphasis">sed</EM> script that removes blank linesfrom text and sends the result to standard output.Article<ACLASS="xref"HREF="ch25_11.htm"TITLE="crush: A cat that Skips all Blank Lines ">25.11</A>.</P></DD><DTCLASS="term">csh_init *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-61073"></A>The <EMCLASS="emphasis">csh_init</EM> file is a collection of C shell commands and aliasdefinitions that are shown throughout the book.Most of these are also available as Bourne-type shell functions in the <EMCLASS="emphasis">sh_init</EM> file.</P><PCLASS="para">In its distributionform, each set of commands is commented out and needs to be explicitlyuncommented before you can use them; this is because many of thedefinitions override or conflict with one another.You can copy or <SPANCLASS="link">source (<ACLASS="linkend"HREF="ch44_23.htm"TITLE="Reading Files with the . and source Commands ">44.23</A>)</SPAN>the file into your<SPANCLASS="link">shell setup file (<ACLASS="linkend"HREF="ch02_02.htm"TITLE="Shell Setup Files-Which, Where, and Why ">2.2</A>)</SPAN>,and then enable the definitions that you want.Articles<ACLASS="xref"HREF="ch02_15.htm"TITLE="Unclutter Logins: Show Login Messages Just Once ">2.15</A>,<ACLASS="xref"HREF="ch07_05.htm"TITLE="Multiline Shell Prompts ">7.5</A>,<ACLASS="xref"HREF="ch07_06.htm"TITLE="Session Information in Your Terminal's Status Line ">7.6</A>,<ACLASS="xref"HREF="ch07_08.htm"TITLE="Highlighting in Shell Prompts ">7.8</A>,<ACLASS="xref"HREF="ch07_11.htm"TITLE="dirs in Your Prompt: Better than $cwd ">7.11</A>,<ACLASS="xref"HREF="ch10_07.htm"TITLE="How to Put if-then-else in a C Shell Alias ">10.7</A>,<ACLASS="xref"HREF="ch10_08.htm"TITLE="Fix Quoting in csh Aliases with makealias and quote ">10.8</A>,<ACLASS="xref"HREF="ch14_09.htm"TITLE="cd by Directory Initials ">14.9</A>,<ACLASS="xref"HREF="ch14_14.htm"TITLE="Automatic Setup When You Enter/Exit a Directory ">14.14</A>,<ACLASS="xref"HREF="ch15_05.htm"TITLE='Matching All "Dot Files&quot; with Wildcards'>15.5</A>,<ACLASS="xref"HREF="ch16_26.htm"TITLE="Finding Text Files with findtext ">16.26</A>,<ACLASS="xref"HREF="ch17_23.htm"TITLE="Finding Files with -prune ">17.23</A>,<ACLASS="xref"HREF="ch21_14.htm"TITLE="Automatically Appending the Date to a Filename ">21.14</A>,<ACLASS="xref"HREF="ch22_02.htm"TITLE="Tutorial on File and Directory Permissions ">22.2</A>,<ACLASS="xref"HREF="ch22_09.htm"TITLE="Protect Important Files: Make Them Unwritable ">22.9</A>,<ACLASS="xref"HREF="ch25_17.htm"TITLE="An Alias in Case You Don't Have tail ">25.17</A>,<ACLASS="xref"HREF="ch29_08.htm"TITLE="Find a a Doubled Word ">29.8</A>,<ACLASS="xref"HREF="ch30_20.htm"TITLE="Multiple Editor Setup Files; Starting with a Search ">30.20</A>,<ACLASS="xref"HREF="ch43_08.htm"TITLE="Fixing Margins with pr and fold ">43.8</A>,<ACLASS="xref"HREF="ch47_05.htm"TITLE="Using C Shell Arrays ">47.5</A>,and<ACLASS="xref"HREF="ch50_08.htm"TITLE="Which Version Am I Using? ">50.8</A>.</P></DD><DTCLASS="term">csh_logout *</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-61105"></A>The <EMCLASS="emphasis">csh_logout</EM> file contains a set of commands forremoving temporary files.C shell users can input these commands into their <EMCLASS="emphasis">~/.logout</EM> file.Article<ACLASS="xref"HREF="ch21_03.htm"TITLE="Unique Names for Temporary Files ">21.3</A>.</P></DD><DTCLASS="term">csplit</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-61114"></A>The <EMCLASS="emphasis">csplit</EM> program splits a file according to context.<EMCLASS="emphasis">csplit</EM> is part of the <EMCLASS="emphasis">textutils</EM> package.Article<ACLASS="xref"HREF="ch35_10.htm"TITLE="Splitting Files by Context: csplit ">35.10</A>.</P></DD><DTCLASS="term">cut+paste</DT><DDCLASS="listitem"><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-61124"></A><ACLASS="indexterm"NAME="AUTOID-61126"></A><ACLASS="indexterm"NAME="AUTOID-61128"></A><EMCLASS="emphasis">cut</EM> and <EMCLASS="emphasis">paste</EM> are public domain versions of AT&amp;T's <EMCLASS="emphasis">cut</EM> and<EMCLASS="emphasis">paste</EM> commands. They are part of the GNU <EMCLASS="emphasis">textutils</EM>package. Articles<A

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -