I was reading this section about the Escape Character:
https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Escape-Character
I then tried two examples to test my (mis)understanding:
Example 1:
----
printf '%s\n' foo\
bar
----
And running example 1 produces what I had expected:
----
bash dev.sh
foo
bar
----
However, if I try it in an assignment operation:
Example 2:
----
str=foo\
bar
----
The output is:
----
bash dev.sh
dev.sh: line 5: bar: command not found
----
In example 2, isn't the backslash causing the \newline to be treated as a
line
continuation and being effectively ignored?
What is going on here?