News for hackers. Stuff that matters.
Re:GNU Parallel – The command line power tool by peterwwillis on Wednesday August 14, 2013 @10:19AM (#6211623)
Why does the parallel example look weird? It put the single quotes in all the wrong places, and completely around Jam. It should have printed

  echo './Ham
  Jam
  Spam'
but your output looks different. As an example of how it should look, try this:

  $ find . -type f -print0 | xargs -n1 -0 perl -e'print "\"$_\" " for (@ARGV)'
  "./Ham
  Jam
  Spam"
Re:GNU Parallel – The command line power tool by davvolun on Wednesday August 14, 2013 @02:59PM (#6213509)
Having never used parallel, I still believe parallel was correct.

./Ham' 'Jam' 'Spam

would be identical to ./Ham\nJam\nSpam (if \n were the correct translation to the newline in this case) or './Ham Jam Spam'

This would be identical to what you wrote, but only punts to quotes when it doesn't have a canonical method of representing the character otherwise. The fact that you don't need to explicitly concatenate two strings in the shell may be what's throwing you off?

Interestingly enough, 'Ham\n\nJam\nSpam' becomes

./Ham' '' 'Jam' 'Spam

So parallel is just literally outputting all newlines using quotes. I believe this would be identical, if you analyzed it and saw that two newlines are next to each other:

./Ham'

'Spam' 'Jam

Re:GNU Parallel – The command line power tool by seryoiupfurds on Wednesday August 14, 2013 @12:18PM (#6212386)
It looks like it's only single-quoting the characters that need it, in his example the newlines.