I need to execute a bash script in node.js. Basically, the script will create user account on the system. I came across this example which gives me an idea how to go about i
var exec = require('child_process').exec; var child = exec('cat *.js | wc -l', function(error, stdout, stderr) { if (error) console.log(error); process.stdout.write(stdout); process.stderr.write(stderr); });
This way is nicer because console.log will print blank lines.