[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Parallel is having trouble handling quotes for unicode characters
From: |
Glen Huang |
Subject: |
Re: Parallel is having trouble handling quotes for unicode characters |
Date: |
Fri, 2 Jun 2017 21:11:26 +0800 |
Thanks for the detailed explanation.
> On 31 May 2017, at 1:17 AM, Ole Tange <ole@tange.dk> wrote:
>
> On Sun, May 28, 2017 at 8:56 AM, Glen Huang <heyhgl@gmail.com> wrote:
>
>> I'm sorry, but I think I just found another strange case:
>>
>> parallel echo 芦港 ::: foo
>>
>> fails with "parallel: Error: Command cannot contain the character ?. Use a
>> function for that."
>>
>> in which case I didn't quote anything.
>
> As you probably are aware unicode characters are multibyte characters.
> GNU Parallel internally uses \257 for placeholder of replacement
> strings.
>
> Outside unicode \257 is rarely (if ever) used on the command line.
>
> In theory it _is_ possible to make GNU Parallel deal correctly with
> all characters, but so far no one has submitted a patch or been
> willing to pay for the development.
>
> The workaround (as GNU Parallel tells you) is to use a function:
>
> myecho() {
> echo 芦港 "$@"
> }
> export -f myecho
> parallel myecho ::: foo
>
> This also works if you have variables:
>
> myvar="foo芦港 "
> export myvar
> myecho() {
> echo "$myvar" "$@"
> }
> export -f myecho
> parallel myecho ::: bar
>
>
> /Ole
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Parallel is having trouble handling quotes for unicode characters,
Glen Huang <=