I would like to do some processing with ex (vim in ex/silent mode). There is however a strange behaviour if a line is empty. An extra space character is added to that line - even in binary mode. Is it possible to eliminate that?
Check out:
$ printf "a\n1st\n\n3rd\n.\n%%p\n" | ex -b | hexdump -C
00000000 31 73 74 0a 20 0a 33 72 64 0a
Note the Ex rows in printf: a
for appending text, three rows, .
to close append mode, %p
to print everything)
a
1st
3rd
.
%p
The expected result is
00000000 31 73 74 0a 0a 33 72 64 0a