Created
January 17, 2017 16:23
-
-
Save pwittchen/fdfb0ec0af09211a7398c00d831acc48 to your computer and use it in GitHub Desktop.
executing shell command via JS - on Linux nodejs ifconfig.js; on macOS node ifconfig.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var process = require('child_process'); | |
process.exec('ifconfig',function (err,stdout,stderr) { | |
if (err) { | |
console.log("\n"+stderr); | |
} else { | |
console.log(stdout); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment