In un nodo.js, mi piacerebbe trovare un modo per ottenere l'output di un comando terminale Unix. C'è un modo per fare questo?Ottieni l'output di un comando shell in node.js
function getCommandOutput(commandString){
//now how can I implement this function?
//getCommandOutput("ls") should print the terminal output of the shell command "ls"
}
Si tratta di un duplicato, o esso descrive qualcosa di completamente diverso? http://stackoverflow.com/questions/7183307/node-js-execute-command-synchronously-and-get-result –
[Questo] (http://davidwalsh.name/sync-exec) potrebbe interessarti. – benekastah