title: How to pass arguments to inline expect in a bash script?
body: <p>I'm creating a shell script to automate the installation of a software which has it's own installer script, but I don't want prompts to the user. So I'm using expect to answer to said script. Right now I have the following:</p>
  
  <pre><code>expect $package -c 'set timeout -1
  set package [lindex $argv 0]
  spawn sh install_pipeline
  expect "Where should I install the software packages ? *"
  send "/usr/local/$package\r"
  expect "Where should I install the pipeline calibration files ? *"
  send "/usr/local/$package\r"
  expect eof'
  </code></pre>
  
  <p>Where package is a variable containing the name of the module to be installed. The problem is, this script doesn't work and prints a message saying: "Couldnt read file "name of the package": no such file or directory.</p>
  
  <p>How can I pass my variable to the expect script? I don't want to create a separate script for expect to keep things simple.</p>