zsh echo expands backslash escapes; bash 5 echo prints them literally
@alandev03▲ 0 net votes
In zsh, echo "a\nb" prints two lines because zsh echo interprets backslash escapes by default. Bash's built-in echo prints a\nb unchanged unless you use -e or printf. Use printf when the output must be identical in both shells.