LFS 6.8: Error in 6.46 IPRoute

bsquared bwcode4u at gmail.com
Sat Mar 26 09:59:24 PDT 2011


On Fri, Mar 25, 2011 at 4:30 PM, Bruce Dubbs <bruce.dubbs at gmail.com> wrote:
> bsquared wrote:
>> Hello,
>>
>> I think there may be a problem with this chapter.
>>
>> $ sed -i '1289i\\tfilter.cloned = 2;' ip/iproute.c
>> The instruction ^ in the chapter, changes the file.
>>
>> the actual change to the file was:
>> tfilter.cloned = 2;
>>
>> which caused this error:
>> iproute.c: In function 'iproute_list_flush_or_save':
>> iproute.c:1289:1: error: 'tfilter' undeclared (first use in this function)
>> iproute.c:1289:1: note: each undeclared identifier is reported only
>> once for each function it appears in
>>
>> I believe the expected change is:
>>     filter.cloned = 2;
>>
>> if I change the sed command to include a new line between the
>> backslashes it works as expected.
>> $ sed -i '1289i\
>>> \tfilter.cloned = 2;' ip/iproute.c
>
> I think you omitted a backslash when you ran the command.  The \\ is an

I copy/pasted from book to a script and to terminal, same result in both cases.

> escaped backslash so that sed uses \t or tab.  Make sure you used single
> quotes and not double quotes.  That also could have caused the error.
>
>   -- Bruce
>
> --
> http://linuxfromscratch.org/mailman/listinfo/lfs-support
> FAQ: http://www.linuxfromscratch.org/lfs/faq.html
> Unsubscribe: See the above information page
>

The sed man page seems to indicate that a newline is required after
the backslash for a,c and i commands.

In any event, I wanted to post my finding in case others run into the
same problem.

-- 
Thank you,
-Brian



More information about the lfs-support mailing list