title: How to remove quotes around each element in bash array created from grep capture
body: <p>In my bash function, I am using grep to capture a matching pattern from a string (selecting the files created), and then storing what is captured in an array. The string is assigned to a variable called <code>output</code></p>
  
  <pre><code>installing route
    create app/routes/foo.js
    create app/templates/foo.hbs
  updating router
    add route foo
  installing route-test
    create tests/unit/routes/foo-test.js
  </code></pre>
  
  <p>after running</p>
  
  <pre><code> files=($(echo "$output" | ggrep -oP 'create\s\K(.+)')) 
  </code></pre>
  
  <p>I confirm that I am capturing what I intend to by running <code>echo ${files[*]}</code>. Output in the terminal looks as so</p>
  
  <pre><code>app/routes/foo.js app/templates/foo.hbs tests/unit/routes/foo-test.js
  </code></pre>
  
  <p>My goal is to pass these files as arguments to an npm script (<code>npm run lint &lt;list of files&gt;</code>). However, when I try to plug in my variable to the npm script execution, the file names either print out like</p>
  
  <pre><code>"app/routes/foo.js" "app/templates/foo.hbs" "tests/unit/routes/foo-test.js"
  </code></pre>
  
  <p>or </p>
  
  <pre><code>"app/routes/foo.js app/templates/foo.hbs tests/unit/routes/foo-test.js"
  </code></pre>
  
  <p>The ultimate goal here is to be able to run </p>
  
  <pre><code>npm run lint app/routes/foo.js app/templates/foo.hbs tests/unit/routes/foo-test.js
  </code></pre>
  
  <p>I have tried tons of combinations to interpolate my <code>file</code> variable, but nothing seems to work. I feel like I am missing something conceptually or approaching this in the wrong way. I originally was trying this without using an array for <code>file</code>, but I was running into the same issue. My first pass is getting this to run in bash. However, I'd prefer to stick with using <code>grep</code> or <code>sed</code> here though. Anyone have any suggestions?</p>
  
  <p>After reading suggestions I have tried</p>
  
  <pre><code>parsedfiles=$(echo "${files[*]}" | sed  -e 's/"//g')
  echo $parsedfiles
  npm run lint $parsedfiles
  </code></pre>
  
  <p>When <code>echo $parsedfiles</code> runs my terminal output looks good <code>app/routes/foo.js app/templates/foo.hbs tests/unit/routes/foo-test.js</code>, but on the next line, it still outputs as <code>npm run "app/routes/foo.js" "app/templates/foo.hbs" "tests/unit/routes/foo-test.js"</code></p>
  
  <p><strong>SOLVED</strong>
  The real issue here wasn't about how I was passing the args in. It's an issue with actually running the <code>npm script</code>. When passing args to the npm script it automatically puts them in double quotes. </p>