node.js - Nodejs nexpect: Get all output lines -
i have simple case want use nexpect list files in folder, , add expect() functionality later.
nexpect.spawn("ls -la /etc") .run(function (err, output, exit) { res.send(output); });
as result, 1 line:
lrwxr-xr-x@ 1 root wheel 11 oct 2 21:42 /etc -> private/etc
my expectation of /etc, since output defined "output {array} array of lines of output examined" (https://github.com/nodejitsu/nexpect).
as side question: nexpect recommendable of today (since hasn't been updated in year)?
it's because on mac, , /etc symlink. try adding /
:
nexpect.spawn("ls -la /etc/") .run(function (err, output, exit) { res.send(output); });
Comments
Post a Comment