Skip to content

Instantly share code, notes, and snippets.

@mape
Forked from jklaiho/gist:473786
Created July 13, 2010 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mape/473792 to your computer and use it in GitHub Desktop.
Save mape/473792 to your computer and use it in GitHub Desktop.
// in REPL
var exec = require('child_process').exec;
var child;
var uid = 123;
child = exec('id -u root', function(error, stdout, stderr) {
uid = parseInt(stdout, 10);
console.log(uid) // prints 0
verifyOutput();
});
function verifyOutput()
{
console.log(uid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment