How to use a linux expect script to enter answer a prompt for password

前端 未结 4 502
忘掉有多难
忘掉有多难 2021-01-19 00:05

I am having some trouble writing a script that will launch my forticlient vpn command line client and send my password when it is prompted. Here is my code:



        
4条回答
  •  青春惊慌失措
    2021-01-19 00:23

    From the comment I got from glenn jackman I was able to figure out that the password prompt was not being matched. I changed my first line to #!/var/bin/expect -d which provided the necessary debugging output to find out the problem and fix it.

    Thanks Glenn!

提交回复
热议问题