Normalized usage of sed throughout the book

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3762 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Zack Winkles 2004-06-07 19:16:21 +00:00
parent 9109cd46dd
commit 2ec4b60f35
10 changed files with 18 additions and 21 deletions

View File

@ -104,6 +104,9 @@ first a summary, then a detailed log.</para>
</itemizedlist>
</listitem>
<listitem><para>June 7, 2004 [winkie]: Normalized <quote>sed</quote> usage
throughout the book.</para></listitem>
<listitem><para>June 7, 2004 [winkie]: Use the
<quote>gcc --print-file specs</quote> command to determine the location of the
<quote>specs</quote> file.</para></listitem>

View File

@ -40,7 +40,7 @@ to the new dynamic linker. A simple sed script will accomplish this:</para>
<!-- Ampersands are needed to allow cut and paste -->
<screen><userinput>SPECFILE=`gcc --print-file specs` &amp;&amp;
sed -e 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \
sed 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \
$SPECFILE &gt; tempspecfile &amp;&amp;
mv -f tempspecfile $SPECFILE &amp;&amp;
unset SPECFILE</userinput></screen>

View File

@ -42,12 +42,12 @@ by applying the following patch:</para>
which is bad since we install udev in a non-standard location. Fix this by
running the following:</para>
<screen><userinput>sed -i 's:\/sbin\/udev:/tools&amp;:' udevstart.c</userinput></screen>
<screen><userinput>sed -i 's@/sbin/udev@/tools/sbin/udev@g' udevstart.c</userinput></screen>
<para>Also assure that udev knows the correct location to look for its
configuration files:</para>
<screen><userinput>sed -i 's:\/etc:/tools&amp;:' etc/udev/udev.conf.in</userinput></screen>
<screen><userinput>sed -i 's@/etc@/tools/etc@g' etc/udev/udev.conf.in</userinput></screen>
<para>Now compile Udev:</para>

View File

@ -36,7 +36,7 @@ by applying the following patch:</para>
from the <filename class="directory">/tools</filename> directory. This is fixed by altering the configure
script:</para>
<screen><userinput>sed -i "s@/usr/include@/tools/include@g" configure</userinput></screen>
<screen><userinput>sed -i 's@/usr/include@/tools/include@g' configure</userinput></screen>
<para>Prepare Util-linux for compilation:</para>

View File

@ -38,7 +38,7 @@ GCC, Glibc, Grep, Make, Sed</seg></seglistitem>
the location of the binary, the following command ensures that the new
location gets placed into the script:</para>
<screen><userinput>sed -i 's%"BINDIR"%/bin%' gzexe.in</userinput></screen>
<screen><userinput>sed -i 's@"BINDIR"@/bin@g' gzexe.in</userinput></screen>
<para>Compile the package:</para>

View File

@ -40,13 +40,13 @@ width instead of being limited to 80 characters:</para>
switch to the <emphasis>PAGER</emphasis> variable so that escape sequences are
properly handled by Less:</para>
<screen><userinput>sed -i 's/-is/&amp;R/' configure</userinput></screen>
<screen><userinput>sed -i 's@-is@&amp;R@g' configure</userinput></screen>
<para>The third is also a sed substitution to comment out the <quote>MANPATH
/usr/man</quote> line in the <filename>man.conf</filename> file to prevent
redundant results when using programs such as <command>whatis</command>:</para>
<screen><userinput>sed -i 's%MANPATH./usr/man%#&amp;%' src/man.conf.in</userinput></screen>
<screen><userinput>sed -i 's@MANPATH./usr/man@#&amp;@g' src/man.conf.in</userinput></screen>
<para>Now prepare Man for compilation:</para>

View File

@ -52,11 +52,8 @@ this:</para>
<!-- Ampersands are needed to allow cut and paste -->
<screen><userinput>SPECFILE=`gcc --print-file specs` &amp;&amp;
sed -e 's@ /tools/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g' \
$SPECFILE &gt; newspecfile &amp;&amp;
mv -f newspecfile $SPECFILE &amp;&amp;
unset SPECFILE</userinput></screen>
<screen><userinput>sed -i 's@ /tools/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g' \
`gcc --print-file specs`</userinput></screen>
<para>Again, cutting and pasting the above is recommended. And just like
before, it is a good idea to visually inspect the specs file to verify the

View File

@ -66,9 +66,9 @@ both these things by changing the relevant configuration file while copying it
to its destination (it's probably better to cut-and-paste this rather than try
and type it all in):</para>
<screen><userinput>sed -e 's%#MD5_CRYPT_ENAB.no%MD5_CRYPT_ENAB yes%' \
-e 's%/var/spool/mail%/var/mail%' \
etc/login.defs.linux &gt; /etc/login.defs</userinput></screen>
<screen><userinput>cp etc/login.defs.linux /etc/login.defs
sed -i -e 's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
-e 's@/var/spool/mail@/var/mail@' /etc/login.defs</userinput></screen>
<para>Move some misplaced symlinks/programs to their proper locations:</para>

View File

@ -36,9 +36,8 @@ run-level. While doing this, <command>init</command> outputs messages like
misinterpretation, you can modify the source so that these messages read like
<quote>Sending processes started by init the TERM signal</quote> instead:</para>
<screen><userinput>cp src/init.c{,.backup}
sed 's/Sending processes/&amp; started by init/g' \
src/init.c.backup &gt; src/init.c</userinput></screen>
<screen><userinput>sed -i 's@Sending processes@&amp; started by init@g' \
src/init.c</userinput></screen>
<para>Compile Sysvinit:</para>

View File

@ -35,9 +35,7 @@ instead of the usual <filename>/etc</filename>, as the location for the
<filename>adjtime</filename> file. To make the <command>hwclock</command>
program FHS-compliant, run the following:</para>
<screen><userinput>cp hwclock/hwclock.c{,.backup}
sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \
hwclock/hwclock.c.backup &gt; hwclock/hwclock.c
<screen><userinput>sed -i 's@etc/adjtime@var/lib/hwclock/adjtime@g' hwclock/hwclock.c
mkdir -p /var/lib/hwclock</userinput></screen>
</sect2>