LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-23-2009, 06:09 PM   #1
Passions
LQ Newbie
 
Registered: Mar 2007
Distribution: RHEL 5.1
Posts: 20

Rep: Reputation: 0
Different fork/expect behavior in RHEL5 and RHEL4...???


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.
 
Old 06-24-2009, 03:54 PM   #2
Passions
LQ Newbie
 
Registered: Mar 2007
Distribution: RHEL 5.1
Posts: 20

Original Poster
Rep: Reputation: 0
Ok, I found a solution for those who might have the same issue in the future.

I copied /usr/lib/libtclx8.4.so from a RHEL4 over to the RHEL5 machine, it works just as before.

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SELinux: RHEL4 to RHEL5 rules migration - unknown type var_lib_t in RHEL5 zbiggy Red Hat 2 05-12-2009 03:14 AM
Determining patch level of Redhat RHEL5 vs RHEL5.1 or RHEL4.5-4.6 dfezz1 Linux - Newbie 2 01-23-2009 09:17 AM
What potential issues could we expect in replacing RHEL3 box with RHEL5? jayunplugged Red Hat 4 03-17-2008 08:21 AM
Expect script to log in to server no longer working - fork broken?? mallarj Linux - General 1 05-06-2007 11:28 AM
Regarding the behavior of function fork() ramkumarv Programming 1 03-08-2006 09:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration