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.

http://i.imgur.com/j7PrY1A.png <http://i.imgur.com/j7PrY1A.png>

Regards

> On 25 May 2017, at 6:47 PM, Ole Tange <[email protected]> wrote:
> 
> On Thu, May 25, 2017 at 6:46 AM, Glen Huang <[email protected]> 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