[Rd] Warning on backslash sequences (was sprintf behavior)
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Sep 28 17:28:14 CEST 2006
On Thu, 28 Sep 2006, Peter Dalgaard wrote:
> "Gabor Grothendieck" <ggrothendieck at 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 at 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
More information about the R-devel
mailing list