TCL Expect kills child of child process
问题 I have an expect script like this #!/usr/bin/expect -f set timeout 30 log_user 0 set PASSWORD $::env(PASSWORD) set USERNAME $::env(USERNAME) set TOKEN $::env(TOKEN) puts stderr "Generating OTP" spawn oathtool --totp $TOKEN expect -re \\d+ set otp $expect_out(0,string) puts stderr "Connecting to VPN server" spawn -ignore HUP env openconnect -b https://vpn expect "GROUP:" send "Tech\n" expect "Username:" send "$USERNAME\n" expect "Password:" send "$PASSWORD\n" expect "Password:" send "$otp\n"