A sed syntax

littlebat dashing.meng at gmail.com
Tue Jun 22 23:24:51 PDT 2010

I am learning LFS BOOK:

Below is a sed syntax I can't understand and haven't found a place to
learn it. 
sed -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}"

I read "man sed" and "info sed" and googled but can't find this kind of
sed usage, can you give me a reference link on the internet or tell
me which section in "info sed"?

I knew "^" indicates the begin of a line and "$" indicates end of a
line, so "^\*cpp:$" indicates a line includes and only includes a
string "*cpp:". And, I also knew the effect of this command is append
string " -isystem /tools/include" to the end of the next line of line
 "*cpp:" by a test. But what's meaning of the every part in "{n;s, $,
-isystem /tools/include,}" and how this command to achieve this



More information about the lfs-support mailing list