Node.js child_process.exec()

I'm trying to exec a child process in node, the name of which is coming from a post request. I'm using express, hence app.post(). My code is below.

app.post('/*', function(req, res) {

  var buf = new Buffer(256);
  var cont_len = buf.write(req.url, -1);
  var controller = buf.toString('utf8', 0, cont_len);
  var controller = controller.concat(' ')

  var args = req.param('args', null);

  var command = __root+__controllers+controller+args;

  console.log(command);

  c = exec(command,

  function (error, stdout, stderr) {
    res.send(stdout);
    res.send(stderr);

    if (error !== null) {
      res.send(error);
    }
  });

});

The part that doesn't work is when I try and build the command string using a dynamic command. I can hardcode the command variable and it works but when i use the variable 'controller' it doesn't exec my process. Also, is there a way of responding with the return value of the child process or must I stick to only using stdout?

You can access request parameters with req.body

var command = req.body.theparam;