0

I have read this post: How to pass local shell script variable to expect?

But my expect script is a single file, not like his.

I have a expect script file:

#!/usr/bin/expect

send "echo 'hello' \n"

exit 0

I also have a bash script file:

#!/bin/bash

a="Neil"
b="Thunel"

expect ./test01.exp 

if [ $? == 0 ]; then
    echo "success!"
else
    echo "fail!"
fi  

I want to pass $a and $b to the expect file, but I don't know how to do with that.

aircraft
  • 25,146
  • 28
  • 91
  • 166

0 Answers0