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

1
  • Can you post your code, which you are using in nodejs? so that its more clear. Commented Aug 30, 2020 at 13:53

1 Answer 1

0

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

 const shell = require('shelljs')

 shell.exec('./path_to_your_file')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.