title: How to one-line this "expect" command?
body: <p>I would like to one-line this</p>
  
  <pre><code>#!/usr/bin/expect
  spawn ssh-copy-id -i .ssh/id_dsa.pub root@testip
  expect "Are you sure you want to continue connecting (yes/no)?"
  send -- "yes\r"
  expect eof
  </code></pre>
  
  <p>which I would assume should be</p>
  
  <pre><code>/usr/bin/expect -c 'expect "\n" { eval spawn ssh-copy-id -i .ssh/id_dsa.pub root@testip; expect "Are you sure you want to continue connecting (yes/no)?"; send -- "yes\r" }'
  </code></pre>
  
  <p>but it is not.</p>
  
  <p>Can anyone see how it should be?</p>