The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Calling expect scripts from other expect scripts seva Shell Programming and Scripting 0 04-03-2008 10:45 AM
Tcl expect HELP dave_m Shell Programming and Scripting 0 02-27-2008 07:08 AM
Expect/Tcl help? earnstaf UNIX for Dummies Questions & Answers 2 07-26-2007 07:01 AM
Expect and auto expect command arun_v Shell Programming and Scripting 0 03-29-2006 04:31 AM
Expect with tcl/tk sanjustudy Shell Programming and Scripting 0 10-10-2005 02:48 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-25-2008
Registered User
 

Join Date: Mar 2008
Location: NJ
Posts: 19
Stumble this Post!
Post tcl/expect

Can someone identify what is the problem here?.

no children
while executing
"exp_wait -nowait -i -1"
(procedure "logOptions" line 45)
invoked from within
"logOptions"
(procedure "doExecute" line 98)
invoked from within
"doExecute"
(procedure "main" line 32)
invoked from within
"main $argc $argv"
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-25-2008
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,160
Stumble this Post!
It's kinda hard to identify without seeing the whole script. What actions have you done prior to the error, how does the error appears, what is the command line invoked, what is the OS in question ?
Reply With Quote
  #3 (permalink)  
Old 03-25-2008
Registered User
 

Join Date: Mar 2008
Location: NJ
Posts: 19
Stumble this Post!
Little background:

This is a expect-tk script which we have it on a Sun-sparc WS. The script was working fine before we upgraded the machine from solaris 9.0 to solaris 10.0. Now the script does not execute properly, as seen in the error message it does not identify the child process and above procedures fail
Code:
    (procedure "logOptions" line 45)
invoked from within
    (procedure "doExecute" line 98)
      (procedure "main" line 32)
   "main $argc $argv"
When I try to execute "exp_wait -nowait -i -1" through catch it seems to be working fine.

If you need any other information please let me know.

Last edited by Yogesh Sawant; 04-18-2008 at 01:14 AM. Reason: added code tags
Reply With Quote
  #4 (permalink)  
Old 03-25-2008
Registered User
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 239
Stumble this Post!
Tcl version btwn 9 & 10? Are you using an expect binary or loading as a package?
The error message is pretty benevolent in theory. It's the same call as:

Code:
waitpid(-1,&status,WNOHANG);
If the child hasn't exited by the time you check for exit then this is the
message you will get. There is also the possibilty that you are simply calling
exec instead of fork and exec in which case behavior is random after the first
wait iirc.

Have you considered asynchronously handling SIGCHLD via trap as an experiment?
Reply With Quote
  #5 (permalink)  
Old 03-25-2008
Registered User
 

Join Date: Mar 2008
Location: NJ
Posts: 19
Stumble this Post!
Tcl version btwn 9 & 10? -- No the solaris version 9 and 10.
Are you using an expect binary or loading as a package? -- it is a binary. (expect1.1)
Have you considered asynchronously handling SIGCHLD via trap as an experiment? -- how do I do that?.
Reply With Quote
  #6 (permalink)  
Old 03-25-2008
Registered User
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 239
Stumble this Post!
Yes, sorry. I meant what are the expect revisions between sol9 and sol10? Are they identical? More importantly are the tcl/tk installations of the same version between
solaris 9 and 10?

If using a mismatched expect binary with different versions of tcl/tk installed behaviors like this are common. OTOH, it could be a bug in the newer version of expect.

As for how to async handle signals you just install a handler.
Code:
proc waitonchld {} {
     set ret [exp_wait -nowait -i -1]
     puts "Handled child exit $ret"
}
trap -code waitonchld {SIGCHLD}
Reply With Quote
  #7 (permalink)  
Old 03-25-2008
Registered User
 

Join Date: Mar 2008
Location: NJ
Posts: 19
Stumble this Post!
Would it right anything?. I mean a "0" or "1"?. Sorry just want to know beforehand what to expect.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
solaris

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0