0

I wrote a bash file with expect command, expecting some output and do actions based on that it works when I execute it in the terminal but when I execute it using exec in nodejs it does not work. I think the output of commands I run in bash file cannot be seen by expect

Rasoul Salehi
  • 485
  • 1
  • 5
  • 11

1 Answers1

0

I usually use, shelljs Package, for executing commands or shell scripts via nodejs.

 const shell = require('shelljs')

 shell.exec('./path_to_your_file')
Jatin Mehrotra
  • 9,286
  • 4
  • 28
  • 67