bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module 'system-quote'


From: Eric Blake
Subject: Re: new module 'system-quote'
Date: Wed, 09 May 2012 16:40:56 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

On 05/09/2012 04:08 PM, Bruno Haible wrote:
> Bastien ROUCARIES wrote:
>> Something like this will work
>> http://stackoverflow.com/a/269819
> 
> Indeed! It allows to substitute newlines.
> 
> $ export NL='
> '
> $ cmd.exe /c 'printf "%s\n" foo^%NL%%NL%bar' | od -t x1
> 0000000 66 6f 6f 0a 62 61 72 0a
> 0000010
> 
> But I don't succeed in getting a carriage-return character in the same way:
> 
> $ eval `echo "export CR='_'" | tr '_' '\r'`
> $ cmd.exe /c 'printf "%s\n" foo^%CR%%CR%bar' | od -t x1

If I understood that page, the magic sequence is '^-newline-char' as the
means to escape 'char'.  Can you use: ^%NL%%CR% to get carriage-return?

> 
> And then there is also the problem with byte sequences that are not
> strings in the current locale encoding...

No idea on that one.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]