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

📄 ch33_12.htm

📁 the unix power tools
💻 HTM
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 33] 33.12 Versions of awk </TITLE><METANAME="DC.title"CONTENT="UNIX Power Tools"><METANAME="DC.creator"CONTENT="Jerry Peek, Tim O'Reilly &amp; Mike Loukides"><METANAME="DC.publisher"CONTENT="O'Reilly &amp; Associates, Inc."><METANAME="DC.date"CONTENT="1998-08-04T21:47:04Z"><METANAME="DC.type"CONTENT="Text.Monograph"><METANAME="DC.format"CONTENT="text/html"SCHEME="MIME"><METANAME="DC.source"CONTENT="1-56592-260-3"SCHEME="ISBN"><METANAME="DC.language"CONTENT="en-US"><METANAME="generator"CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"><LINKREV="made"HREF="mailto:online-books@oreilly.com"TITLE="Online Books Comments"><LINKREL="up"HREF="ch33_01.htm"TITLE="33. Batch Editing"><LINKREL="prev"HREF="ch33_11.htm"TITLE="33.11 Quick Reference: awk "><LINKREL="next"HREF="ch34_01.htm"TITLE="34. The sed Stream Editor"></HEAD><BODYBGCOLOR="#FFFFFF"TEXT="#000000"><DIVCLASS="htmlnav"><H1><IMGSRC="gifs/smbanner.gif"ALT="UNIX Power Tools"USEMAP="#srchmap"BORDER="0"></H1><MAPNAME="srchmap"><AREASHAPE="RECT"COORDS="0,0,466,58"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="467,0,514,18"HREF="jobjects/fsearch.htm"ALT="Search this book"></MAP><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch33_11.htm"TITLE="33.11 Quick Reference: awk "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 33.11 Quick Reference: awk "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 33<BR>Batch Editing</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="CHAPTER"HREF="ch34_01.htm"TITLE="34. The sed Stream Editor"><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 34. The sed Stream Editor"BORDER="0"></A></TD></TR></TABLE>&nbsp;<HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="SECT1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-7960">33.12 Versions of awk </A></H2><PCLASS="para"><EMCLASS="emphasis">awk</EM> was introduced as part of UNIX's seventhedition and has been part of the standarddistribution ever since.<ACLASS="indexterm"NAME="AUTOID-38184"></A><ACLASS="indexterm"NAME="AUTOID-38187"></A><ACLASS="indexterm"NAME="AUTOID-38190"></A><ACLASS="indexterm"NAME="AUTOID-38193"></A><ACLASS="indexterm"NAME="AUTOID-38196"></A></P><PCLASS="para">In 1985, the authors of <EMCLASS="emphasis">awk</EM>extended the language, adding many useful features.Unfortunately,this new version remained inside AT&amp;T for several years.It became a regular part of AT&amp;T's System V as of Release 3.1.Itcan be found under the name of <EMCLASS="emphasis">nawk</EM> (for new <EMCLASS="emphasis">awk</EM>);the older version still exists under its original name.</P><TABLECLASS="para.programreference"BORDER="1"><TR><THVALIGN="TOP"><ACLASS="programreference"HREF="examples/index.htm"TITLE="gawk">gawk</A><BR></TH><TDVALIGN="TOP">Unfortunately, <EMCLASS="emphasis">nawk</EM> is not available on all systems.The good news is thatthe<SPANCLASS="link">Free Software Foundation (<ACLASS="linkend"HREF="glossary.htm#UPT-ART-1010"TITLE="Glossary">52.9</A>)</SPAN>GNU project's version of <EMCLASS="emphasis">awk</EM>, called <EMCLASS="emphasis">gawk</EM>, implements all the features of the new <EMCLASS="emphasis">awk</EM>. </TD></TR></TABLE><PCLASS="para">Ingeneral, you can assume that what is true for <EMCLASS="emphasis">nawk</EM> is true for<EMCLASS="emphasis">gawk</EM>, unless <EMCLASS="emphasis">gawk</EM> is explicitly called out.Scriptswritten for <EMCLASS="emphasis">nawk</EM> are 100&nbsp;percent compatible with <EMCLASS="emphasis">gawk</EM>.If you want to use one of the <EMCLASS="emphasis">nawk</EM> scripts, anddon't have<EMCLASS="emphasis">nawk</EM> on your system, simply change the script to invoke<EMCLASS="emphasis">gawk</EM> instead.</P><PCLASS="para">There are a few areas where <EMCLASS="emphasis">gawk</EM> has introduced <EMCLASS="emphasis">gawk</EM>-specificfeatures; however, recent versions of <EMCLASS="emphasis">nawk</EM> support many of thesefeatures, suggesting that the remaining differences are really veryminor.This shouldn't matter in any case, since we do supply<EMCLASS="emphasis">gawk</EM> on the disc.</P><PCLASS="para">This book doesn't cover any of the <EMCLASS="emphasis">awk</EM>s in detail.The recent <EMCLASS="emphasis">awk</EM>s, especially, have quite a few features incommon&nbsp;- so documentation for any one of them should help you learn theothers.</P><PCLASS="para">In this book, we show scripts for <EMCLASS="emphasis">awk</EM> as well as scripts thatonly work on <EMCLASS="emphasis">nawk</EM> and <EMCLASS="emphasis">gawk</EM>.But we barely scratch the surface of all the <EMCLASS="emphasis">awk</EM>s' features.The completely revised second edition of O'Reilly &amp; Associates' <EMCLASS="emphasis">sed &amp;awk</EM> has detailed information on all of them.[2]There's also lots of documentation on the CD-ROM.Take your pick.</P><BLOCKQUOTECLASS="footnote"><PCLASS="para">[2] And thanks to Arnold Robbins, co-author of the second edition,for his help with this section and other <EMCLASS="emphasis">awk</EM> material in this book.</P></BLOCKQUOTE><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">JP</SPAN>, <SPANCLASS="authorinitials">DD,&nbsp;TOR</SPAN></P></DIV></DIV><DIVCLASS="htmlnav"><P></P><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch33_11.htm"TITLE="33.11 Quick Reference: awk "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 33.11 Quick Reference: awk "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="book"HREF="index.htm"TITLE="UNIX Power Tools"><IMGSRC="gifs/txthome.gif"SRC="gifs/txthome.gif"ALT="UNIX Power Tools"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="CHAPTER"HREF="ch34_01.htm"TITLE="34. The sed Stream Editor"><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 34. The sed Stream Editor"BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">33.11 Quick Reference: awk </TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="index"HREF="index/idx_0.htm"TITLE="Book Index"><IMGSRC="gifs/index.gif"SRC="gifs/index.gif"ALT="Book Index"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172">34. The sed Stream Editor</TD></TR></TABLE><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><IMGSRC="gifs/smnavbar.gif"SRC="gifs/smnavbar.gif"USEMAP="#map"BORDER="0"ALT="The UNIX CD Bookshelf Navigation"><MAPNAME="map"><AREASHAPE="RECT"COORDS="0,0,73,21"HREF="../index.htm"ALT="The UNIX CD Bookshelf"><AREASHAPE="RECT"COORDS="74,0,163,21"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="164,0,257,21"HREF="../unixnut/index.htm"ALT="UNIX in a Nutshell"><AREASHAPE="RECT"COORDS="258,0,321,21"HREF="../vi/index.htm"ALT="Learning the vi Editor"><AREASHAPE="RECT"COORDS="322,0,378,21"HREF="../sedawk/index.htm"ALT="sed &amp; awk"><AREASHAPE="RECT"COORDS="379,0,438,21"HREF="../ksh/index.htm"ALT="Learning the Korn Shell"><AREASHAPE="RECT"COORDS="439,0,514,21"HREF="../lrnunix/index.htm"ALT="Learning the UNIX Operating System"></MAP></DIV></BODY></HTML>

⌨️ 快捷键说明

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