tag 20954 + notabug
close 20954
thanks
Maybe we did not understand.
I don't want change old definitions but create new option for wc or echo,
because this above examples not make logic sense,
( and it I want fix, however with sed is also fixed )
however now Iunderstand that they work correctly in accordance with
accepted principles.
# What is a text line? A text line by definition ends with a newline.
This has been standardized to prevent
# different implementations from implementing it differently and
creating portability problems. Therefore
# all standards compliant implementations must implement it in the same
way to prevent portability
# problems.
" wc -l " in most examples working correct,
because it " echo " give's " \n " and "wc -l" count correct.
I mentioned about "wc", because for me build option "wc -a" for "echo"
or "echo -m"
this is not important.
Maybe exist hope for example create option "m" to echo , " echo -m "
which not will from new line, but first line if variable is empty
and from new line if is not empty ?
example:
echo -m "" | wc -l
0
echo -m "e" | wc -l
1