title: expect vs. bash read
body: <p>I'm trying to use <code>expect</code> to talk to a <code>bash</code> script, but I'm missing something. My script is:</p>
  
  <pre><code>#!/bin/bash
  echo -n "foo? "
  read
  echo $REPLY
  </code></pre>
  
  <p>and my <code>expect</code> script is:</p>
  
  <pre><code>#!/usr/bin/expect
  spawn ./script.sh
  expect "foo? "
  send "bar\r\n"
  </code></pre>
  
  <p>But I never see <code>bar</code> when I run the <code>expect</code> script. What am I missing here?</p>