I need to to free a port by running a command kill `lsof -t -i:4723` from a
node.js file my code is
var sys = require('sys')
var exec = require('child_process').exec;
var child;
child = exec("kill `lsof -t -i:4723`", function (error, stdout, stderr)
{
sys.print('stdout: ' + value);
sys.print('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
it works fine but it is only for port 4723 and i want to take variabe say
portnumber and then use **kill `lsof -t -i:$portnumber`** instead of
**kill `lsof -t -i:4723`** and the value for the variable portnumber is
obtained from code file
How to do this ?
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.