title: Unexpected bash quoting behaviour
body: <p>I have a pipeline of bash commands that looks like this:</p>
  
  <pre><code>cat report.json | \
  ./jq '.outdated.dependencies[] |  {group, name, "version": .available.milestone} | .group + ":" + .name + ":" + .version' | \
  xargs -0 -d'\n' -I DEPENDENCY echo ./gradlew clean test -PdependencyOverrides=DEPENDENCY
  </code></pre>
  
  <p>The output of this command is:</p>
  
  <pre><code>./gradlew clean test -PdependencyOverrides="org.flywaydb:flyway-core:4.0.3"
  ./gradlew clean test -PdependencyOverrides="org.hibernate:hibernate-c3p0:5.2.5.Final"
  ./gradlew clean test -PdependencyOverrides="org.hibernate:hibernate-core:5.2.5.Final"
  ./gradlew clean test -PdependencyOverrides="org.hibernate:hibernate-entitymanager:5.2.5.Final"
  ./gradlew clean test -PdependencyOverrides="org.hibernate:hibernate-java8:5.2.5.Final"
  ./gradlew clean test -PdependencyOverrides="org.hibernate:hibernate-validator:5.3.3.Final"
  ./gradlew clean test -PdependencyOverrides="com.fasterxml.jackson.core:jackson-databind:2.8.5"
  ./gradlew clean test -PdependencyOverrides="com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.5"
  ./gradlew clean test -PdependencyOverrides="javax.el:javax.el-api:3.0.1-b04"
  ./gradlew clean test -PdependencyOverrides="org.apache.logging.log4j:log4j-api:2.7"
  ./gradlew clean test -PdependencyOverrides="org.apache.logging.log4j:log4j-core:2.7"
  ./gradlew clean test -PdependencyOverrides="org.apache.logging.log4j:log4j-slf4j-impl:2.7"
  ./gradlew clean test -PdependencyOverrides="org.mockito:mockito-core:2.2.28"
  ./gradlew clean test -PdependencyOverrides="org.postgresql:postgresql:9.4.1212"
  ./gradlew clean test -PdependencyOverrides="com.getsentry.raven:raven-log4j2:7.8.1"
  ./gradlew clean test -PdependencyOverrides="com.sparkjava:spark-core:2.5.4"
  ./gradlew clean test -PdependencyOverrides="org.springframework:spring-jdbc:4.3.4.RELEASE"
  ./gradlew clean test -PdependencyOverrides="org.springframework.restdocs:spring-restdocs-restassured:1.1.2.RELEASE"
  </code></pre>
  
  <p>This is exactly what I am expecting. If I copy and paste one of these commands, they do exactly what I want them to do. Now I don't want to print these commands but directly execute them. However, as soon as I remove the <code>echo</code> from the <code>xargs</code> command, it doesn't work. "It doesn't work" means that the property is not correctly passed to gradle.</p>
  
  <p>In order to debug this issue, I tried to append <code>| bash -x</code> to my pipeline which revealed the issue but I don't know how to solve it.<br>
  Appending this yields the following output as the first line:</p>
  
  <pre><code>+ ./gradlew clean test $'-PdependencyOverrides=org.flywaydb:flyway-core:4.0.3\r'
  </code></pre>
  
  <p>I assume, the problem is that <code>bash</code> for some reason I don't know puts the arguments in quotes and prepends them with <code>$</code>. If I execute the command exactly as it is printed here, the same error occurs as if I let <code>xargs</code> directly run the command.   </p>
  
  <p><strong>What do I have to change so the commands are executed exactly the way they are printed when I add the <code>echo</code> to the <code>xargs</code> command?</strong></p>
  
  <p><a href="http://pastebin.com/cNRWT6TA" rel="nofollow noreferrer">Here</a> is the <code>report.json</code> file if anyone wants to reproduce this locally and <code>jq</code> can be downloaded <a href="https://stedolan.github.io/jq/" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Gradle is not needed to reproduce this problem, as executing the command in a folder without a <code>gradlew</code> file just yields:</p>
  
  <pre><code>+ ./gradlew clean test $'-PdependencyOverrides=org.flywaydb:flyway-core:4.0.3\r'
  bash: line 1: ./gradlew: No such file or directory
  </code></pre>
  
  <p>which still demonstrates the problem.</p>
  
  <p>I am not sure what the exact problem is, so if there is a better title feel free to change it.</p>