473,320 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Quoting style in C

Hi

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

Jul 13 '07 #1
2 1307
mathieu <ma***************@gmail.comwrote:
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
Jul 13 '07 #2
Richard Bos wrote:
mathieu <ma***************@gmail.comwrote:
>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.
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
Jul 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: snacktime | last post by:
I'm used to using the perl DBI and not very familiar with the python DB-API. I am using PyGreSQL. My question is what is the standard way to quote strings in sql queries? I didn't see any...
22
by: Jane Withnolastname | last post by:
I have been using the charset windows-1252 for a while, but it was pointed out to someone else in this group recently that it's a Microsoft creation (I'm sure I'm getting my facts wrong or skewed)...
383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
27
by: Ron Adam | last post by:
Hi, I found the following to be a useful way to access arguments after they are passed to a function that collects them with **kwds. class namespace(dict): def __getattr__(self, name): return...
4
by: Tim Robinson | last post by:
Hi, I generally consider myself competent with the complexities of quoting but I can't figure out postgres at all. I've read the manual and it looks very straightforward but that doesn't accord...
12
by: yoni | last post by:
Hi, Consider the following XML document: <article> This is a sample <literal>document</literal>. Some <literal>words</literal>, from some reason, are tagged with the...
10
by: Michael Hoffman | last post by:
Does anyone have a script to convert more conventional USENET quoting style like this: John wrote: > Jacob Jingleheimer Schmidt <jjs@example.net> wrote in message-id <gratuitous-detail> on 29...
2
by: seven.reeds | last post by:
Hi, I am not a js expert by any stretch and this might be a perl question more than js but I have to start somewhere so fingers crossed... Ok, I am doing some ajax and have this '<input...
7
by: Steven W. Orr | last post by:
Python has a number of "quoting" 'options' to help """with times when""" one way may be more convenient than another. In the world of shell scripting, I use a technique that I call minimal...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.