I need to execute a bash script in node.js. Basically, the script will create user account on the system. I came across this example which gives me an idea how to go about it. However, the script itself needs arguments like the username, the password and the real name of the user. I still can't figure out how to pass those arguments to the script doing something like this:
var commands = data.toString().split('
').join(' && ');
Does anyone have an idea how I can pass those arguments and execute the bash script within node.js over an ssh connection. thanks
question from:https://stackoverflow.com/questions/7464036/node-js-shell-script-and-arguments