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   ebl...@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to