[email protected] wrote:
> Dear Bruce:
>
> I don't know why the command resulted in an error: invalid reference
\1 on `s' command's RHS
> mm... maybe it's a bad idea to use -ir option and -e with the 'find'
command ?
>
> In order to make sure sed command executable,
> I try to remove -r option and escape the parens,
> and another issue is to make sure searched string lead by ^BUILD_ARCHIVE
>
> Finally, I change with following commands and work well.
>
> find -name Makefile -exec sed -i -e '/^LIBRARYNAME/a SHARED_LIBRARY = 1'
> -e 's#^BUILD_ARCHIVE :*= 1#NO_BUILD_ARCHIVE = 1#'
> -e '/^USEDLIBS/s# \([A-Za-z]*\).a# -l\1#g'
> -e 's#^USEDLIBS#LDFLAGS#' {} \;
It worked perfectly for me just now when I rechecked it. What version
of sed are you using? I'm using sed-4.2.1 from LFS 7.0.
One of the objectives of LFS/BLFS is to teach new concepts. I like to
add the -r switch to the book when it is useful to do that.
Note that the book has:
find -name Makefile -exec \
sed -ir -e '/^LIBRARYNAME/a SHARED_LIBRARY = 1' \
-e 's#BUILD_ARCHIVE :*= 1#NO_&#' \
-e '/^USEDLIBS/s# ([A-Za-z]*).a# -l\1#g' \
-e 's#^USEDLIBS#LDFLAGS#' {} \;
Did you miss the first backslash?
To be consistent, I probably should move the && on the configure line
above the 'find' to the same column as the rest of the segment.
-- Bruce
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page