#!/usr/bin/bash
work_path=$1
cd ${work_path}
/usr/bin/expect <<-EOF
spawn make LDFLAGS=-ltirpc results
expect -re {
  "MULTIPLE COPIES [default 1]:" {send "\r"; exp_continue}
  "Job placement selection [default 1]:" {send "\r"; exp_continue}
  "MB [default.*.]:" {send "1024"; exp_continue}
  "SUBSET (ALL|HARWARE|OS|DEVELOPMENT) [default all]:" {send "\r"; exp_continue}
  "FASTMEM [default no]:" {send "\r"; exp_continue}
  "SLOWFS [default no]:" {send "\r"; exp_continue}
  "DISKS [default none]:" {send "\r"; exp_continue}
  "REMOTE [default none]:" {send "\r"; exp_continue}
  "Processor mhz.*.:" {send "\r"; exp_continue}
  "FSDIR [default /usr/tmp]:" {send "\r"; exp_continue}
  "Status output file [default /dev/tty]:" {send "\r"; exp_continue}
  "Mail results [default yes]:" {send "no\r"; exp_continue};
}
interact
expect eof
EOF
