So I have a piece of code that looks like this:
Code:
#!/usr/bin/expect
if {[fork]==0} then {
spawn bash
send "echo hi\r"
expect eof
exit
}
In RHEL4.4, it spits out this:
Code:
[root@asdf scripts]# ./test.sh
spawn bash
[root@asdf scripts]# echo hi
[root@asdf scripts]# echo hi
hi
But in RHEL5.1, I only get this:
Code:
[root@asdf scripts]# ./test.sh
spawn bash
[root@asdf scripts]#
I don't receive any "hi". Anyone know why fork or expect is behaving differently? I looked at the versions of expect, on RHEL4.4 it's 5.42.1 and on RHEL5.1 it's 5.43. I tried to downgrade the version of expect on the 5.1 machine, but it still didn't work. Any ideas?
Thanks.