Re: Quoting style in C



mathieu <mathieu.malaterre@xxxxxxxxx> wrote:

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.

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
.