Quote:
Originally Posted by ondoho
But as it is, no, expect cannot somehow magically reach into the previous line of a shell script.
|
The first problem is the sudo itself, it will open a new shell and do something within. Every line after that sudo will be executed when sudo already completed and not in the child process. You can use expect and sudo together, but that has a quite different syntax (and you will find a lot of examples on the net:
https://askubuntu.com/questions/3070...in-bash-script)