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
Asked
Active
Viewed 125 times
0
-
Can you post your code, which you are using in nodejs? so that its more clear. – Jatin Mehrotra Aug 30 '20 at 13:53
1 Answers
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