PREV INDEX NEXT

Author: Unknown
Subject: many escape chars in a row
Date: Saturday, 26 Sep 2020, 21:33:50

I was testing many escape characters in a row to understand their behavior, and I came across this example:
echo hello \\\\; echo world
> hello \
> world

Why is the output not the following?
> hello \\
> world

Because I thought the first \ escapes the second \ (thus printing \) and the third \ escapes the fourth \ (printing a second \). But only one \ is printed.
PREV INDEX NEXT