So I am trying to spawn a shell to a remote server then make a screen run some commands and then detach from said screen by doing:
#!/usr/bin/expect
set server [lindex $argv 0]
spawn s "$server"
expect "#" { send "screen -S test\r" }
expect "#" { send \someescapeheretoreplicate ctrl + a then d to tell screen to detach }
interact
But I have no idea what those escape sequences are called so am unable to look up a table of them or what not.
If I recall:
send "\x01"; send "d"
Where \x01 is the value of Ctrl-A
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With