How to use the output of the shell command in expect script's send
问题 I have a expect script written to perform a login operation. The login requires the 2fa code, this code can be obtained by executing the shell command 2fa my_login . Now how do I execute the 2fa command and pass it's output to the send of my script? I need to do something like send -- "$(2fa my_login)" . The output of the $(2fa my_login) should be passed to the send. My script #!/usr/bin/expect -f set timeout -1 spawn /home/local/apps/forticlientsslvpn/64bit/forticlientsslvpn_cli --server vpn