The printf command offers well-defined behavior following the POSIX standard, which means it works the same way across shells ...
That n is the reason that the echo command can also be used to add a linefeed to the end of a file that, for some reason, lacks one. Here’s a file that lacks a linefeed followed by the command that ...