1

I am trying to execute an external bash script from nodejs.

The script when executed from terminal, prompts for input, such as a password.

When executing from nodejs, i can not get it to pause to read the input.

Can not find any good info online on this.

Is this not possible?

var shelljs = require( 'shelljs' )

var returns     = shelljs.exec("passwd", {shell: '/bin/bash'}, {stdio:'inherit'});

passwd: conversation failure

mjs
  • 21,431
  • 31
  • 118
  • 200

1 Answers1

0
  shelljs.exec("exec </dev/tty\n passwd", ... )

  seems to work. found by accident. 

Not sure if this is the best way though.

Not very solid i think.

mjs
  • 21,431
  • 31
  • 118
  • 200