Re: [Rd] Warning on backslash sequences (was sprintf behavior)

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu 28 Sep 2006 - 15:28:14 GMT

On Thu, 28 Sep 2006, Peter Dalgaard wrote:

> "Gabor Grothendieck" <ggrothendieck@gmail.com> writes:
>
>> That's a good idea for the case I mentioned although there is still
>> the case where one requires a single quoted string (maybe for
>> generating code for some other language) and that is
>> not handled by deparse.
>
> Yes, but there be devils lurking in there. I think you do in general
> need to know what the other language is. Take a look at shQuote(), for
> instance. (Why, BTW, does that not simply "escape" single quotes using
> '"'"' instead of switching to double-quotes and escaping everything in
> sight?)

I suspect because the references consulted suggested that was not portable. Since 'sh' covers many variants (at least Bourne sh, ash, bash, ksh, zsh) it is hard to get definitive answers.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Fri Sep 29 01:29:15 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 28 Sep 2006 - 16:30:37 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.