[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNU Parallel Bug Reports sem does not handle strings with single quo
From: |
Ole Tange |
Subject: |
Re: GNU Parallel Bug Reports sem does not handle strings with single quotes in them |
Date: |
Wed, 17 Jul 2019 06:17:11 +0200 |
On Tue, Jul 16, 2019 at 5:07 PM Jason Lewis <address@hidden> wrote:
> sem does not seem to handle strings with single quotes in them.
>
> eg:
>
> jason@sage:~/test$ echo 1\'1
> 1'1
> jason@sage:~/test$ sem echo 1\'1
> jason@sage:~/test$ /bin/bash: -c: line 0: unexpected EOF while looking
> for matching `''
> /bin/bash: -c: line 1: syntax error: unexpected end of file
>
> I expect sem should run correctly with escaped strings.
You see the same with basic parallel:
$ parallel echo 1\'1 ::: 1
/bin/bash: -c: line 0: unexpected EOF while looking for matching `''
/bin/bash: -c: line 1: syntax error: unexpected end of file
Workaround: use -q.
sem -q echo 1\'1
parallel -q echo 1\'1 ::: 1
The reason is that GNU Parallel allows this:
# This prints: a b
sem 'echo a; echo b'
# This prints: a; echo b
sem -q 'echo a; echo b'
and this:
$ parallel perl -e \''print "{}\n"'\' ::: 1
1
$ parallel -q perl -e 'print "{}\n"' ::: 1
1
/Ole