const exec = require('child_process').exec;
exec('cat /dev/urandom |od -x|head -n 1', (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
});
为什么执行这段语句,完全没反应?
而在终端执行完全正常。
The default maximum allowed amount of data output to stdout and stderr by exec does not exceed 200K. If it exceeds, the child process will be killed.
Here, let me give you a door https://segmentfault.com/q/10...