$ cat x.sed
3i\
foo\
$ sedparse -f x.sed
[
{
"a1": {
"addr_number": 3,
"addr_type": 3
},
"cmd": "i",
"line": 1,
"x": {
"cmd_txt": {
"text": [
"f",
"o",
"o",
"\\",
"\n",
"\n"
]
}
}
}
]
$
Note that inside x.cmd_txt.text, there's a double \n when there should be only one.
In the x.sed file, the last line is foo\, which implies there will be a new line to the i command text. But there isn't. Note that for GNU sed, it works the same as if it was a normal foo in the last line:
$ seq 5 | sed -e '3i\' -e 'foo'
1
2
foo
3
4
5
$ seq 5 | sed -e '3i\' -e 'foo\'
1
2
foo
3
4
5
$
sedparse should not return that extra \n in this case.
Note that inside
x.cmd_txt.text, there's a double\nwhen there should be only one.In the
x.sedfile, the last line isfoo\, which implies there will be a new line to theicommand text. But there isn't. Note that for GNU sed, it works the same as if it was a normalfooin the last line:sedparse should not return that extra
\nin this case.