bug-parallel
[Top][All Lists]
Advanced

[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: Jason Lewis
Subject: Re: GNU Parallel Bug Reports sem does not handle strings with single quotes in them
Date: Wed, 17 Jul 2019 15:14:57 +1000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0


Ole Tange wrote on 17/7/19 2:17 pm:
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


Thanks Ole.

-q does the trick. May I suggest that -q be documented in sem(1) ? (please ignore if it is. I'm on Debian stretch with sem v 20161222)

Thanks,

Jason


    
-- 
Jason Lewis
http://emacstragic.net

reply via email to

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