I was struggling with a weird path. So I decided to use a fancy
option in ls to help me out. But I think the output is incorrect.
Steps:
mkdir /tmp/bla
touch "/tmp/bla/filename with | pipe"
ls --quoting-style=c /tmp/bla
returns:
"filename with \| pipe"
I do not think escaping | is correct in C.
Comments ?
-Mathieu
You are right. '\|' is not a defined escape character in C; its value is
implementation-defined.
(Of course, one might nit-pick and say that the _style_ of escaping is
that used by C, even if this particular escape _character_ is not in the
C Standard.)
Richard
No, it is not defined (by the grammar rule for escape-sequence)
and requires a diagnostic; there is even a footnote on 6.4.4.4
which explicitly states this.
6.11.4 allows it in extensions though.
Ralf