parallel
[Top][All Lists]
Advanced

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

Re: Parallel is having trouble handling quotes for unicode characters


From: Ole Tange
Subject: Re: Parallel is having trouble handling quotes for unicode characters
Date: Tue, 30 May 2017 19:17:32 +0200

On Sun, May 28, 2017 at 8:56 AM, Glen Huang <address@hidden> 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



reply via email to

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