On Sun, Mar 25, 2018 at 03:59:14PM +0100, [email protected] wrote:
> [...]
> If not how can I send ^D (ctrl+D a.k.a end of file) in expect script please?


        # ASCII 4: EOT (end of transmission)
        set ctrlD \004

        send $ctrlD

-- 
Jean
#!/usr/bin/expect

set host "myhost.example.com"

set ctrlD \004
set prompt {.* \$}

spawn ssh $host

expect -re $prompt {
  send "ls\r"
}

expect -re $prompt {
  send $ctrlD
}

expect {closed}
_______________________________________________
juniper-nsp mailing list [email protected]
https://puck.nether.net/mailman/listinfo/juniper-nsp

Reply via email to