script.expect (210B)
1 set timeout 10 2 3 spawn socat unix-connect:vm/console - 4 send "\r\n" 5 expect "login:" { send "root\r\n" } 6 expect "#" 7 send "echo HELLO WORLD > /hello\r\n" 8 expect "#" 9 send "cat /hello\r\n" 10 expect 'HELLO WORLD' 11 close