Parcourir la source

Bug 125: simplify seds

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@973 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Mark Hymers il y a 24 ans
Parent
commit
8f5efb6200

+ 3 - 3
chapter06/glibc-exp.xml

@@ -16,7 +16,7 @@ that it can't read the file, so we simply create an empty file (the empty file
 will have Glibc default to using /lib and /usr/lib which is fine 
 right now).</para>
 
-<para><userinput>sed s/"\$(PERL)"/"\/usr\/bin\/perl"/
+<para><userinput>sed 's|$(PERL)|/usr/bin/perl|' 
 ../glibc-2.2.3/malloc/Makefile &gt; tmp~:</userinput> This sed command
 searches through <filename>../glibc-2.2.3/malloc/Makefile</filename> and
 converts all occurances of <filename>$(PERL)</filename> to
@@ -31,7 +31,7 @@ Glibc.</para>
 when using sed, we can't write straight back to this file so we need to
 use a temporary file in between.</para>
 
-<para><userinput>sed "s/root/0" ../glibc-2.2.3/login/Makefile &gt;
+<para><userinput>sed 's/root/0' ../glibc-2.2.3/login/Makefile &gt;
 tmp~:</userinput> This sed command replaces all occurances of
 <filename>root</filename> in
 <filename>../glibc-2.2.3/login/Makefile</filename> with 0.  This is
@@ -46,7 +46,7 @@ edited Makefile and then copying it back over the original.</para>
 <para><userinput>--enable-add-ons:</userinput> This enables the add-on that
 we install with Glibc: linuxthreads</para>
 
-<para><userinput>sed s/"cross-compiling = yes"/"cross-compiling = no"/
+<para><userinput>sed 's/cross-compiling = yes/cross-compiling = no/'
 config.make &gt; config.make~:</userinput> This time, we're replacing
 <filename>cross-compiling = yes</filename> with
 <filename>cross-compiling = no</filename>.  We do this because we are

+ 3 - 3
chapter06/glibc-inst.xml

@@ -15,15 +15,15 @@ would do.</para>
 <userinput>touch /etc/ld.so.conf &amp;&amp;</userinput>
 <userinput>mkdir ../glibc-build &amp;&amp;</userinput>
 <userinput>cd ../glibc-build &amp;&amp;</userinput>
-<userinput>sed s/"\$(PERL)"/"\/usr\/bin\/perl"/ \</userinput>
+<userinput>sed 's|$(PERL)|/usr/bin/perl|' \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;../glibc-&glibc-version;/malloc/Makefile &gt; tmp~ &amp;&amp;</userinput>
 <userinput>mv tmp~ ../glibc-&glibc-version;/malloc/Makefile &amp;&amp;</userinput>
-<userinput>sed "s/root/0/" ../glibc-&glibc-version;/login/Makefile &gt; tmp~ &amp;&amp;</userinput>
+<userinput>sed 's/root/0/' ../glibc-&glibc-version;/login/Makefile &gt; tmp~ &amp;&amp;</userinput>
 <userinput>mv tmp~ ../glibc-&glibc-version;/login/Makefile &amp;&amp;</userinput>
 <userinput>../glibc-&glibc-version;/configure \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;--prefix=/usr --enable-add-ons \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;--libexecdir=/usr/bin &amp;&amp;</userinput>
-<userinput>sed s/"cross-compiling = yes"/"cross-compiling = no"/ \</userinput>
+<userinput>sed 's/cross-compiling = yes/cross-compiling = no/' \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;config.make &gt; config.make~ &amp;&amp;</userinput>
 <userinput>mv config.make~ config.make &amp;&amp;</userinput>
 <userinput>make &amp;&amp;</userinput>

+ 1 - 1
chapter06/procinfo-exp.xml

@@ -1,7 +1,7 @@
 <sect2>
 <title>Command explanations</title>
 
-<para><userinput>sed "s/-ltermcap/-lncurses/" Makefile | make -f -:</userinput> 
+<para><userinput>sed 's/-ltermcap/-lncurses/' Makefile | make -f -:</userinput> 
 This will replace -ltermcap with -lncurses in the Makefile and pipe the
 output of sed (the modified Makefile) directly to the make program. This
 is an alternate and more efficient way to direct the output to a file

+ 1 - 1
chapter06/procinfo-inst.xml

@@ -3,7 +3,7 @@
 
 <para>Install Procinfo by running the following commands:</para>
 
-<para><screen><userinput>sed "s/-ltermcap/-lncurses/" Makefile | make -f - &amp;&amp;</userinput>
+<para><screen><userinput>sed 's/-ltermcap/-lncurses/' Makefile | make -f - &amp;&amp;</userinput>
 <userinput>make install</userinput></screen></para>
 
 </sect2>

+ 1 - 1
chapter06/utillinux-inst.xml

@@ -5,7 +5,7 @@
 adjtime file, instead of the usual /etc. To make hwclock, which is part of the
 util-linux package, FHS-compliant, run the following.</para>
 
-<para><screen><userinput>sed "s|etc/adjtime\"\$|var/lib/hwclock/adjtime\"|" \</userinput>
+<para><screen><userinput>sed 's|etc/adjtime|var/lib/hwclock/adjtime|' \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;hwclock/hwclock.c &gt; hwclock~ &amp;&amp;</userinput>
 <userinput>mv hwclock~ hwclock/hwclock.c &amp;&amp;</userinput>
 <userinput>mkdir /var/lib/hwclock</userinput></screen></para>