The problem was not in my code, but my clipboard itself. the echo command adds \n at the end, as it ends the line. But the code was correct.
echo
\n