Index: chapter06/glibc-exp.xml
===================================================================
--- chapter06/glibc-exp.xml	(revision 8ac74394772c35626799ce34100df0decdb7fc04)
+++ chapter06/glibc-exp.xml	(revision 8c5e7152f076d6b68a23e6629a44b49763557f48)
@@ -13,28 +13,18 @@
 
 <para><userinput>sed 's%\$(PERL)%/usr/bin/perl%' 
-malloc/Makefile &gt; tmp~:</userinput> This sed command
-searches through <filename>malloc/Makefile</filename> and
+malloc/Makefile.backup &gt; malloc/Makefile:</userinput> This sed command
+searches through <filename>malloc/Makefile.backup</filename> and
 converts all occurrences of <filename>$(PERL)</filename> to
-<filename>/usr/bin/perl</filename>.  The output is then written to the
-file <filename>tmp~</filename>.  This is done because Glibc can't
-autodetect perl since it hasn't been installed yet.</para>
+<filename>/usr/bin/perl</filename>. The output is then written to the
+original <filename>malloc/Makefile.in</filename> which is used during
+configuration. This is done because Glibc can't autodetect perl since
+it hasn't been installed yet.</para>
 
-<para><userinput>mv tmp~ malloc/Makefile:</userinput> The file
-<filename>tmp~</filename> is now moved back to
-<filename>malloc/Makefile</filename>.  We do this because
-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' login/Makefile &gt;
-tmp~:</userinput> This sed command replaces all occurences of
-<filename>root</filename> in
-<filename>login/Makefile</filename> with 0.  This is
-because as we don't have glibc on the LFS system yet, usernames can't 
-be resolved to their user id's.  Therefore, we replace the username 
-root with the id 0. </para>
-
-<para><userinput>mv tmp~ login/Makefile:</userinput> As above, we are using 
-a temporary file (<filename>tmp~</filename>) to store the
-edited Makefile and then copying it back over the original.</para>
+<para><userinput>sed 's/root/0' login/Makefile.backup &gt;
+login/Makefile:</userinput> This sed command replaces all occurences of
+<filename>root</filename> in <filename>login/Makefile.backup</filename>
+with 0. This is because we don't have glibc on the LFS system yet, so
+usernames can't be resolved to their user id's. Therefore, we replace
+the username root with user id 0.</para>
 
 <para><userinput>--enable-add-ons:</userinput> This enables the add-on that
@@ -45,16 +35,14 @@
 
 <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
-only building for our own system.  Cross-compiling is used, for
-instance, to build a package for an Apple Power PC on an Intel system.
-The reason Glibc thinks we're cross-compiling is that it can't compile a
-test program to determine this, so it automatically defaults to a
-cross-compiler. The reason for the failed program is because Glibc
-hasn't been installed yet.</para>
-
-<para><userinput>mv config.make~ config.make:</userinput> Again, we are moving
-the temporary file over the original.</para>
+config.make.backup &gt; config.make:</userinput> This time, sed searches
+through <filename>config.make.backup</filename> and replaces all occurences
+of <filename>cross-compiling = yes</filename> with
+<filename>cross-compiling = no</filename>. We do this because we are
+only building for our own system. Cross-compiling is used, for instance,
+to build a package for an Apple Power PC on an Intel system. The reason
+Glibc thinks we're cross-compiling is that it can't compile a test program
+to determine this, so it automatically defaults to a cross-compiler.
+Compiling the test program failes because Glibc hasn't been installed
+yet.</para>
 
 <para><userinput>exec /bin/bash:</userinput>This command will
Index: chapter06/glibc-inst.xml
===================================================================
--- chapter06/glibc-inst.xml	(revision 8ac74394772c35626799ce34100df0decdb7fc04)
+++ chapter06/glibc-inst.xml	(revision 8c5e7152f076d6b68a23e6629a44b49763557f48)
@@ -18,9 +18,7 @@
 touch /etc/ld.so.conf &amp;&amp;
 cp malloc/Makefile malloc/Makefile.backup &amp;&amp;
-sed 's%\$(PERL)%/usr/bin/perl%' malloc/Makefile &gt; tmp~ &amp;&amp;
-mv tmp~ malloc/Makefile &amp;&amp;
+sed 's%\$(PERL)%/usr/bin/perl%' malloc/Makefile.backup &gt; malloc/Makefile &amp;&amp;
 cp login/Makefile login/Makefile.backup &amp;&amp;
-sed 's/root/0/' login/Makefile &gt; tmp~ &amp;&amp;
-mv tmp~ login/Makefile &amp;&amp;
+sed 's/root/0/' login/Makefile.backup &gt; login/Makefile &amp;&amp;
 mkdir ../glibc-build &amp;&amp;
 cd ../glibc-build &amp;&amp;
@@ -29,6 +27,5 @@
 cp config.make config.make.backup &amp;&amp;
 sed 's/cross-compiling = yes/cross-compiling = no/' \
-&nbsp;&nbsp;&nbsp;config.make &gt; tmp~ &amp;&amp;
-mv tmp~ config.make &amp;&amp;
+&nbsp;&nbsp;&nbsp;config.make.backup &gt; config.make &amp;&amp;
 make &amp;&amp;
 make install &amp;&amp;
Index: chapter06/shadowpwd-exp.xml
===================================================================
--- chapter06/shadowpwd-exp.xml	(revision 8ac74394772c35626799ce34100df0decdb7fc04)
+++ chapter06/shadowpwd-exp.xml	(revision 8c5e7152f076d6b68a23e6629a44b49763557f48)
@@ -2,8 +2,8 @@
 <title>Command explanations</title>
 
-<para><userinput>sed 's/\(.*\) (nflg || \(.*\))\(.*\)/\1\2\3/' src/useradd.c 
-&gt; useradd.c.temp &amp;&amp;</userinput>: This sed is used to fix a 
-compilation bug which occurs due to a variable (nflg) being used but not 
-defined.</para>
+<para><userinput>sed 's/\(.*\) (nflg || \(.*\))\(.*\)/\1\2\3/'
+src/useradd.c.backup &gt; src/useradd.c &amp;&amp;</userinput>:
+This sed is used to fix a compilation bug which occurs due to a
+variable (nflg) being used but not defined.</para>
 
 <para><userinput>cp limits login.access /etc:</userinput> These files
Index: chapter06/shadowpwd-inst.xml
===================================================================
--- chapter06/shadowpwd-inst.xml	(revision 8ac74394772c35626799ce34100df0decdb7fc04)
+++ chapter06/shadowpwd-inst.xml	(revision 8c5e7152f076d6b68a23e6629a44b49763557f48)
@@ -12,6 +12,5 @@
 <para><screen><userinput>cp src/useradd.c src/useradd.c.backup &amp;&amp;
 sed 's/\(.*\) (nflg || \(.*\))\(.*\)/\1\2\3/' \
-&nbsp;&nbsp;&nbsp;src/useradd.c &gt; tmp~ &amp;&amp;
-mv tmp~ src/useradd.c &amp;&amp;
+&nbsp;&nbsp;&nbsp;src/useradd.c.backup &gt; src/useradd.c &amp;&amp;
 ./configure --prefix=/usr &amp;&amp;
 make &amp;&amp;
Index: chapter06/sysvinit-inst.xml
===================================================================
--- chapter06/sysvinit-inst.xml	(revision 8ac74394772c35626799ce34100df0decdb7fc04)
+++ chapter06/sysvinit-inst.xml	(revision 8c5e7152f076d6b68a23e6629a44b49763557f48)
@@ -14,6 +14,5 @@
 <para><screen><userinput>cp src/init.c src/init.c.backup &amp;&amp;
 sed 's/\(.*\)\(Sending processes\)\(.*\)/\1\2 started by init\3/' \
-&nbsp;&nbsp;&nbsp;src/init.c &gt; tmp~ &amp;&amp;
-mv tmp~ src/init.c</userinput></screen></para>
+&nbsp;&nbsp;&nbsp;src/init.c.backup &gt; src/init.c</userinput></screen></para>
 
 <para>Install Sysvinit by running the following commands:</para>
Index: chapter06/utillinux-inst.xml
===================================================================
--- chapter06/utillinux-inst.xml	(revision 8ac74394772c35626799ce34100df0decdb7fc04)
+++ chapter06/utillinux-inst.xml	(revision 8c5e7152f076d6b68a23e6629a44b49763557f48)
@@ -8,6 +8,5 @@
 <para><screen><userinput>cp hwclock/hwclock.c hwclock/hwclock.c.backup &amp;&amp;
 sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \
-&nbsp;&nbsp;&nbsp;hwclock/hwclock.c &gt; tmp~ &amp;&amp;
-mv tmp~ hwclock/hwclock.c &amp;&amp;
+&nbsp;&nbsp;&nbsp;hwclock/hwclock.c.backup &gt; hwclock/hwclock.c &amp;&amp;
 mkdir -p /var/lib/hwclock</userinput></screen></para>
 
Index: chapter06/vim-inst.xml
===================================================================
--- chapter06/vim-inst.xml	(revision 8ac74394772c35626799ce34100df0decdb7fc04)
+++ chapter06/vim-inst.xml	(revision 8c5e7152f076d6b68a23e6629a44b49763557f48)
@@ -10,5 +10,6 @@
 <para>Install Vim by running the following commands:</para>
 
-<para><screen><userinput>sed '/shUntil\|link shRepeat/{
+<para><screen><userinput>cp runtime/syntax/sh.vim runtime/syntax/sh.vim.backup &amp;&amp;
+sed '/shUntil\|link shRepeat/{
 &nbsp;&nbsp;&nbsp;/shUntil/N
 &nbsp;&nbsp;&nbsp;/^/i\
@@ -18,6 +19,5 @@
 &nbsp;&nbsp;&nbsp;endif
 &nbsp;&nbsp;&nbsp;d
-&nbsp;&nbsp;&nbsp;}' runtime/syntax/sh.vim &gt; sh.vim.fixed &amp;&amp;
-mv sh.vim.fixed runtime/syntax/sh.vim &amp;&amp;
+&nbsp;&nbsp;&nbsp;}' runtime/syntax/sh.vim.backup &gt; runtime/syntax/sh.vim &amp;&amp;
 ./configure --prefix=/usr &amp;&amp;
 make CPPFLAGS=-DSYS_VIMRC_FILE=\\\"/etc/vimrc\\\" &amp;&amp;
@@ -42,5 +42,6 @@
 instead of the one presented above:</para>
 
-<para><screen><userinput>sed '/shUntil\|link shRepeat/{
+<para><screen><userinput>cp runtime/syntax/sh.vim runtime/syntax/sh.vim.backup &amp;&amp;
+sed '/shUntil\|link shRepeat/{
 &nbsp;&nbsp;&nbsp;/shUntil/N
 &nbsp;&nbsp;&nbsp;/^/i\
@@ -50,6 +51,5 @@
 &nbsp;&nbsp;&nbsp;endif
 &nbsp;&nbsp;&nbsp;d
-&nbsp;&nbsp;&nbsp;}' runtime/syntax/sh.vim &gt; sh.vim.fixed &amp;&amp;
-mv sh.vim.fixed runtime/syntax/sh.vim &amp;&amp;
+&nbsp;&nbsp;&nbsp;}' runtime/syntax/sh.vim.backup &gt; runtime/syntax/sh.vim &amp;&amp;
 ./configure --prefix=/usr --localstatedir=/var/lib/vim &amp;&amp;
 make CPPFLAGS=-DSYS_VIMRC_FILE=\\\"/etc/vimrc\\\" &amp;&amp;
