What does spawn ,expect and send command in linux/unix

24,077

It is part of an expect script:

spawn opens a new process

expect waits for the previous spawned process to output the "expected" string (password in this case)

send writes to the spawned process stdin

EOD has no meaning in expect, perhaps it is part of another script?

Share:
24,077
Admin
Author by

Admin

Updated on June 16, 2020

Comments

  • Admin
    Admin about 4 years

    The following three lines having three commands(spawn,expect,send), but what it does actually. Please explain any one

    spawn ssh -oStrictHostKeyChecking=no -oCheckHostIP=no usr@$myhost.example.com'<br>
    expect "password"<br>
    send "$PWD\n" <br>
    EOD
    
  • Jason Lee
    Jason Lee almost 7 years
    I think the pasted code snippet should have another EOD prior to it. Here it simply indicates the end of the here doc.