Skip to main content
added 155 characters in body
Source Link
Rakesh Sharma
  • 1.1k
  • 1
  • 6
  • 3

you were almost there. Just need to add escaped newlines in the inserted text.

/^\*[ \t]/i\
\
\* ATTENTION \*\

However, the idiomatic way of doing it, which is posixly, portable, nd avoids backslashing is:

/^[*][[:blank:]]/!b
H;s/.*//;x
s/./&** ACHTUNG **&&/

you were almost there. Just need to add escaped newlines in the inserted text.

/^\*[ \t]/i\
\
\* ATTENTION \*\

you were almost there. Just need to add escaped newlines in the inserted text.

/^\*[ \t]/i\
\
\* ATTENTION \*\

However, the idiomatic way of doing it, which is posixly, portable, nd avoids backslashing is:

/^[*][[:blank:]]/!b
H;s/.*//;x
s/./&** ACHTUNG **&&/
Source Link
Rakesh Sharma
  • 1.1k
  • 1
  • 6
  • 3

you were almost there. Just need to add escaped newlines in the inserted text.

/^\*[ \t]/i\
\
\* ATTENTION \*\