Skip to content
Advertisement

issue in logging in as sudo user

here is the script sample.expect :

JavaScript

expecting to log into the host as sudo user. but getting issue [sudo] password for USER: invalid command name “sudo” while executing “sudo” invoked from within “expect “[sudo] password for USER:”” (file “sample.expect” line 6).

Advertisement

Answer

JavaScript

That uses square brackets, which are Tcl’s mechanism for command substitition. You have to either escape the leading bracket, or use Tcl’s non-interpolating quotes: one of

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement