$k has a trailing newline in it and $l doesn't echo is adding a trailing newline to $l making the files equal.