I'm attempting to do something I think is very simple -- execute an 'echo' line using child_process.exec. My code looks as such:
var exec = require('child_process').exec;
exec('echo "HELLO"', function (error, stdout, stderr) {
console.log(error);
console.log(stdout);
console.log(stderr);
});
As of now, the echo is never being called and neither is the callback. Is there something I'm missing here?
Also, I'm using thins inside a grunt task I'm creating, so I'm not sure if there's anything there that could set it off (though this plugin seems to be doing it fine here --https://github.com/sindresorhus/grunt-shell/blob/master/tasks/shell.js)
'echo "HELLO"'
. Is that just in the question? Do you receive any errors? Since it's within a Grunt task, is the task defined to be asynchronous? – Sodalitynull
and thenHELLO
and a blank string. – Sweatbandthis.async()
and the returned callback within the task or Grunt will interrupt theexec()
. – Sodality