It ensures that the output ends with a new line; cm:
echo -ne test | sed '$a\'
As you can see with the previous code, the carriage return in the second example is not added, but one is added in the first example. Of course, if you delete the sed part, the output will be different, since the first echo statement does not have a carriage return.
source share