mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-18 11:19:19 +01:00
Bug 125: simplify seds
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@973 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
2bcd77192f
commit
8f5efb6200
@ -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 > 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 >
|
||||
<para><userinput>sed 's/root/0' ../glibc-2.2.3/login/Makefile >
|
||||
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 > 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
|
||||
|
@ -15,15 +15,15 @@ would do.</para>
|
||||
<userinput>touch /etc/ld.so.conf &&</userinput>
|
||||
<userinput>mkdir ../glibc-build &&</userinput>
|
||||
<userinput>cd ../glibc-build &&</userinput>
|
||||
<userinput>sed s/"\$(PERL)"/"\/usr\/bin\/perl"/ \</userinput>
|
||||
<userinput>sed 's|$(PERL)|/usr/bin/perl|' \</userinput>
|
||||
<userinput> ../glibc-&glibc-version;/malloc/Makefile > tmp~ &&</userinput>
|
||||
<userinput>mv tmp~ ../glibc-&glibc-version;/malloc/Makefile &&</userinput>
|
||||
<userinput>sed "s/root/0/" ../glibc-&glibc-version;/login/Makefile > tmp~ &&</userinput>
|
||||
<userinput>sed 's/root/0/' ../glibc-&glibc-version;/login/Makefile > tmp~ &&</userinput>
|
||||
<userinput>mv tmp~ ../glibc-&glibc-version;/login/Makefile &&</userinput>
|
||||
<userinput>../glibc-&glibc-version;/configure \</userinput>
|
||||
<userinput> --prefix=/usr --enable-add-ons \</userinput>
|
||||
<userinput> --libexecdir=/usr/bin &&</userinput>
|
||||
<userinput>sed s/"cross-compiling = yes"/"cross-compiling = no"/ \</userinput>
|
||||
<userinput>sed 's/cross-compiling = yes/cross-compiling = no/' \</userinput>
|
||||
<userinput> config.make > config.make~ &&</userinput>
|
||||
<userinput>mv config.make~ config.make &&</userinput>
|
||||
<userinput>make &&</userinput>
|
||||
|
@ -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
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
<para>Install Procinfo by running the following commands:</para>
|
||||
|
||||
<para><screen><userinput>sed "s/-ltermcap/-lncurses/" Makefile | make -f - &&</userinput>
|
||||
<para><screen><userinput>sed 's/-ltermcap/-lncurses/' Makefile | make -f - &&</userinput>
|
||||
<userinput>make install</userinput></screen></para>
|
||||
|
||||
</sect2>
|
||||
|
@ -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> hwclock/hwclock.c > hwclock~ &&</userinput>
|
||||
<userinput>mv hwclock~ hwclock/hwclock.c &&</userinput>
|
||||
<userinput>mkdir /var/lib/hwclock</userinput></screen></para>
|
||||
|
Loading…
Reference in New Issue
Block a user