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
1 Answer
I usually use, shelljs Package, for executing commands or shell scripts via nodejs.
const shell = require('shelljs')
shell.exec('./path_to_your_file')