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: Glen Huang
Subject: Re: Parallel is having trouble handling quotes for unicode characters
Date: Fri, 26 May 2017 10:44:56 +0800

Thanks for the quick reply. Didn't realize {} is already quotes.

But if the solution is to not quote {}, how do I pass "${start} {}" as a single argument to subshell?

For example,

parallel name=\"foo {}\"';' echo \"'$name'\" ::: 你好 世界

would garble the text,

but

parallel name=foo {}';' echo \"'$name'\" ::: 你好 世界

would try to execute the unicode characters as commands.

And I did get \?\?\?\?\?\? back, as can be seen from this screenshot. I use the terminal app on macOS.


Regards

On 25 May 2017, at 6:47 PM, Ole Tange <ole@tange.dk> wrote:

On Thu, May 25, 2017 at 6:46 AM, Glen Huang <heyhgl@gmail.com> wrote:

Parallel is having trouble handling quotes for me. If I run

parallel echo \"'{}'\" ::: 你好 世界

I get \?\?\?\?\?\? back.

Are you sure you do not get:

\�\�\�\�\�\�
\�\�\�\�\�\�

My mental model for this cmd is that echo "你好" and echo "世界" would be pass to the subshell, and it should print those characters without problem.

And it would do that, if you had not quoted {}. {} is quoted by GNU
Parallel itself so it should not be quoted any further:

$ parallel echo {} ::: 你好 世界
你好
世界

export start="你好"
parallel -a file name=\"'${start} {}'\"';' curl -o /dev/null \"'$url/$start/$name'\"

Move {} outside the quotes and it should work.


/Ole


reply via email to

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