grep.html

来自「lfs3.1 从源代码构建linux。html版本。」· HTML 代码 · 共 322 行

HTML
322
字号
<HTML><HEAD><TITLE>Installing Grep-2.4.2</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.63"><LINKREL="HOME"TITLE="Linux From Scratch"HREF="../index.html"><LINKREL="UP"TITLE="Preparing the LFS system"HREF="../chapter05/chapter05.html"><LINKREL="PREVIOUS"TITLE="Installing GCC-2.95.3"HREF="../chapter05/gcc.html"><LINKREL="NEXT"TITLE="Installing Gzip-1.2.4a"HREF="../chapter05/gzip.html"></HEAD><BODYCLASS="sect1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Linux From Scratch: Version 3.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="../chapter05/gcc.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 5. Preparing the LFS system</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="../chapter05/gzip.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="sect1"><H1CLASS="sect1"><ANAME="ch05-grep">5.10. Installing Grep-2.4.2</A></H1><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen">Estimated build time:           1 minuteEstimated required disk space:  4 MB</PRE></FONT></TD></TR></TABLE><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1149">5.10.1. Installation of Grep</A></H2><P>When installing Grep using glibc-2.1.x on your base system,it may be necessary to use a fix to prevent a variable name conflict.  Thefollowing commands can be used in this case.  Note that these commandscan also be used for other glibc versions so if you aren't sure, thenuse the first version.</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>export CPPFLAGS=-Dre_max_failures=re_max_failures2 &#38;&#38;./configure --prefix=$LFS/usr --disable-nls &#38;&#38;unset CPPFLAGS &#38;&#38;make LDFLAGS=-static &#38;&#38;make install</B></TT></PRE></FONT></TD></TR></TABLE></P><P>If you are using a newer glibc version (2.2.x), you can use thefollowing commands to install Grep:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>./configure --prefix=$LFS/usr --disable-nls &#38;&#38;make LDFLAGS=-static &#38;&#38;make install</B></TT></PRE></FONT></TD></TR></TABLE></P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1159">5.10.2. Contents</A></H2><P>The grep package contains the egrep, fgrep and grep programs.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1162">5.10.3. Description</A></H2><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN1164">5.10.3.1. egrep</A></H3><P>egrep prints lines from files matching an extended regular expressionpattern.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN1167">5.10.3.2. fgrep</A></H3><P>fgrep prints lines from files matching a list of fixed strings,separated by newlines, any of which is to be matched.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN1170">5.10.3.3. grep</A></H3><P>grep prints lines from files matching a basic regular expressionpattern.</P></DIV></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1173">5.10.4. Dependencies</A></H2><P>Grep-2.4.2 needs the following to be installed:</P><PCLASS="literallayout"><br>sh&nbsp;from&nbsp;the&nbsp;bash&nbsp;package<br><br>ar&nbsp;from&nbsp;the&nbsp;binutils&nbsp;package<br>as&nbsp;from&nbsp;the&nbsp;binutils&nbsp;package<br>ld&nbsp;from&nbsp;the&nbsp;binutils&nbsp;package<br><br>cmp&nbsp;from&nbsp;the&nbsp;diffutils&nbsp;package<br><br>chmod&nbsp;from&nbsp;the&nbsp;fileutils&nbsp;package<br>cp&nbsp;from&nbsp;the&nbsp;fileutils&nbsp;package<br>ln&nbsp;from&nbsp;the&nbsp;fileutils&nbsp;package<br>ls&nbsp;from&nbsp;the&nbsp;fileutils&nbsp;package<br>mkdir&nbsp;from&nbsp;the&nbsp;fileutils&nbsp;package<br>rm&nbsp;from&nbsp;the&nbsp;fileutils&nbsp;package<br><br>cc&nbsp;from&nbsp;the&nbsp;gcc&nbsp;package<br><br>egrep&nbsp;from&nbsp;the&nbsp;grep&nbsp;package<br>grep&nbsp;from&nbsp;the&nbsp;grep&nbsp;package<br><br>make&nbsp;from&nbsp;the&nbsp;make&nbsp;package<br><br>sed&nbsp;from&nbsp;the&nbsp;sed&nbsp;package<br><br>basename&nbsp;from&nbsp;the&nbsp;sh-utils&nbsp;package<br>expr&nbsp;from&nbsp;the&nbsp;sh-utils&nbsp;package<br>sleep&nbsp;from&nbsp;the&nbsp;sh-utils&nbsp;package<br>uname&nbsp;from&nbsp;the&nbsp;sh-utils&nbsp;package<br><br>cat&nbsp;from&nbsp;the&nbsp;textutils&nbsp;package<br>tr&nbsp;from&nbsp;the&nbsp;textutils&nbsp;package<br></P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="../chapter05/gcc.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="../chapter05/gzip.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Installing GCC-2.95.3</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../chapter05/chapter05.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Installing Gzip-1.2.4a</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

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