Newline is the name of the newline character, i.e. the character usually written as
\n in C:
b"; echo "$p"
The result is
ab rather than
\a<newline>b since the POSIX standard says:
<backslash> that is not quoted shall preserve the literal value of the following character, with the exception of a
<newline>. If a
<newline> follows the
<backslash> the shell shall interpret this as line continuation. The
<newline> shall be removed before splitting the input into tokens. Since the escaped
<newline> is removed entirely from the input and is not replaced by any white space, it cannot serve as a token separator.
But the string is quoted with double quotes... Well, this is a special case:
<backslash> shall retain its special meaning as an escape character only when followed by one of the following characters when considered special:
So the double-quoted string means that the backslash-newline is interpreted as if it was not quoted at all, which means it act as a line-continuation and both the backslash and newline are removed.
Note that this happens as you assign to the
p variable, not when you
See also Security implications of forgetting to quote a variable in bash/POSIX shells about the neccecity of quoting your variables, always.