title: Passing argv from route into a script in Node without single quotes
body: <p>I have a project with a landing page which uploads a file into the server; then select some parameters including the uploaded filename and pass them to a script to deploy that file to another server.
  I have trouble into passing the filename as parameter for the script. I managed with, inside the upload.js route </p>
  
  <pre><code>var fileName = util.inspect(files.upload.name);
  var fileSize = util.inspect(files.upload.size);
  process.argv = fileName;
  </code></pre>
  
  <p>And then calling in deploy.js route</p>
  
  <pre><code>var env = Object.create(process.env);
  env.package = process.argv;
  </code></pre>
  
  <p>so if I try to load a file called try.sql, it passes into the argv array as 'try.sql'. How can I pass it to the script without single quotes?</p>
  
  <p>The script now is very simple:</p>
  
  <pre><code>cp /c/users/alex.buaiscia/Documents/Developing/node/uploads/$package /c/users/alex.buaiscia/Documents/Developing/
  </code></pre>
  
  <p>so for clarifying, it returns: </p>
  
  <pre><code>stderr: cp: cannot stat "/c/users/alex.buaiscia/Documents/Developing/node/uploads/'try.sql'"
  </code></pre>
  
  <p>Whole project is on public github
  <a href="https://github.com/buaiscia/newPKI" rel="nofollow noreferrer">https://github.com/buaiscia/newPKI</a></p>
  
  <p>Thanks!</p>
  
  <p>---update with current solution----</p>
  
  <pre><code>///// PASSING ARGUMENT FILENAME TO SCRIPT
      var env = Object.create(process.env);
      env.package = process.argv;
  
      var array1 = env.package;
  
      console.log(array1.slice(1, -1));
      var array2 = array1.slice(1, -1);
  
  
      var command = 'sh c:/users/alex.buaiscia/Documents/Developing/node/scripts/testdeploy.sh ' + array2 + ' &gt;&gt; log.txt'
      console.log(command);
   exec(command, { env: env }, function(error, stdout, stderr) {
          console.log('done')
          console.log('stdout:', stdout);
          console.log('stderr:', stderr);
      });
  </code></pre>
  
  <p>+ testdeploy.sh</p>
  
  <pre><code>echo $(date) 'prova deployment'
  echo $(date) $1
  cp /c/users/alex.buaiscia/Documents/Developing/node/uploads/$1 /c/users/alex.buaiscia/Documents/Developing/node/
  </code></pre>