Answers for "manually enter sudo password in expect script"

0

manually enter sudo password in expect script

expect {
    "Input 1" { send -- "$env(input1)\r"; exp_continue }
    "Input 2" { send -- "$env(input2)\r"; exp_continue }
    # Only this bit is necessary
    "password for" { stty -echo
                    interact -u tty_spawn_id -o "\r" return
                    stty echo
                    exp_continue }
     # Up to here
    eof
}
Posted by: Guest on July-30-2021

Code answers related to "manually enter sudo password in expect script"

Browse Popular Code Answers by Language