From 2ec4b60f359413c6f0163b9e72108c24460573e7 Mon Sep 17 00:00:00 2001 From: Zack Winkles Date: Mon, 7 Jun 2004 19:16:21 +0000 Subject: Normalized usage of sed throughout the book git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3762 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/gzip.xml | 2 +- chapter06/man.xml | 4 ++-- chapter06/readjusting.xml | 7 ++----- chapter06/shadow.xml | 6 +++--- chapter06/sysvinit.xml | 5 ++--- chapter06/util-linux.xml | 4 +--- 6 files changed, 11 insertions(+), 17 deletions(-) (limited to 'chapter06') diff --git a/chapter06/gzip.xml b/chapter06/gzip.xml index 4804b48ad..0cb8f2b57 100644 --- a/chapter06/gzip.xml +++ b/chapter06/gzip.xml @@ -38,7 +38,7 @@ GCC, Glibc, Grep, Make, Sed the location of the binary, the following command ensures that the new location gets placed into the script: -sed -i 's%"BINDIR"%/bin%' gzexe.in +sed -i 's@"BINDIR"@/bin@g' gzexe.in Compile the package: diff --git a/chapter06/man.xml b/chapter06/man.xml index 552d07d21..54f7174a6 100644 --- a/chapter06/man.xml +++ b/chapter06/man.xml @@ -40,13 +40,13 @@ width instead of being limited to 80 characters: switch to the PAGER variable so that escape sequences are properly handled by Less: -sed -i 's/-is/&R/' configure +sed -i 's@-is@&R@g' configure The third is also a sed substitution to comment out the MANPATH /usr/man line in the man.conf file to prevent redundant results when using programs such as whatis: -sed -i 's%MANPATH./usr/man%#&%' src/man.conf.in +sed -i 's@MANPATH./usr/man@#&@g' src/man.conf.in Now prepare Man for compilation: diff --git a/chapter06/readjusting.xml b/chapter06/readjusting.xml index c8c2f4bbd..a81c540f6 100644 --- a/chapter06/readjusting.xml +++ b/chapter06/readjusting.xml @@ -52,11 +52,8 @@ this: -SPECFILE=`gcc --print-file specs` && -sed -e 's@ /tools/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g' \ - $SPECFILE > newspecfile && -mv -f newspecfile $SPECFILE && -unset SPECFILE +sed -i 's@ /tools/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g' \ + `gcc --print-file specs` 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 diff --git a/chapter06/shadow.xml b/chapter06/shadow.xml index 0018929a2..1ce985807 100644 --- a/chapter06/shadow.xml +++ b/chapter06/shadow.xml @@ -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): -sed -e 's%#MD5_CRYPT_ENAB.no%MD5_CRYPT_ENAB yes%' \ - -e 's%/var/spool/mail%/var/mail%' \ - etc/login.defs.linux > /etc/login.defs +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 Move some misplaced symlinks/programs to their proper locations: diff --git a/chapter06/sysvinit.xml b/chapter06/sysvinit.xml index 9f2ad48f8..4f098a0b0 100644 --- a/chapter06/sysvinit.xml +++ b/chapter06/sysvinit.xml @@ -36,9 +36,8 @@ run-level. While doing this, init outputs messages like misinterpretation, you can modify the source so that these messages read like Sending processes started by init the TERM signal instead: -cp src/init.c{,.backup} -sed 's/Sending processes/& started by init/g' \ - src/init.c.backup > src/init.c +sed -i 's@Sending processes@& started by init@g' \ + src/init.c Compile Sysvinit: diff --git a/chapter06/util-linux.xml b/chapter06/util-linux.xml index 64658f402..fbd42374a 100644 --- a/chapter06/util-linux.xml +++ b/chapter06/util-linux.xml @@ -35,9 +35,7 @@ instead of the usual /etc, as the location for the adjtime file. To make the hwclock program FHS-compliant, run the following: -cp hwclock/hwclock.c{,.backup} -sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \ - hwclock/hwclock.c.backup > hwclock/hwclock.c +sed -i 's@etc/adjtime@var/lib/hwclock/adjtime@g' hwclock/hwclock.c mkdir -p /var/lib/hwclock -- cgit v1.2.3-54-g00ecf