Operating System - HP-UX
1834178 Members
2510 Online
110064 Solutions
New Discussion

Unexpected end of a KSH script

 
Enrico Venturi
Super Advisor

Unexpected end of a KSH script

Hi all,
I'm using the KSH in HP-UX 10.20. In a script A I call the script B then B calls the script C.
It seems impossible but when C ended the control flow is returned not to B but to A.
A and C are different files.
B is a function contained in an environmental file which is executed before starting C.

It seems that the stack is corrupted ...
Have you any ideas?

thank you very much
2 REPLIES 2
Sridhar Bhaskarla
Honored Contributor

Re: Unexpected end of a KSH script

Hi,

As per your message, B is not a script but a function contained in the environmental file. So, it means it is not to be viewed as a seperate shell but as that of A. So, I am not surprized if C behaves as if it is the child process of A.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Enrico Venturi
Super Advisor

Re: Unexpected end of a KSH script

Thank you for your reply.
As per my question: C returns to A, ok!, but C has been called by function B which belongs to A, and C returns "out of" B ... it returns to the A code immediately after the B function ... it seems that the "return mechanisms" ignores the B function (not always ...).
I try to explaing again:
A script =

./usr/mycode/myfunctions (B is defined into myfunctions)
./usr/mycode/env
...
...
B
... <--------+
... |
end |
|
B: |
... |
C |
... |
end |
|
C: |
... |
... |
exit 0 -------|

thans !