If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > exit command in tru64 4.0g and tru64 5.1 UNIX

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-08-03, 08:53
sandhya george sandhya george is offline
Registered User
 
Join Date: Jan 2003
Posts: 1
exit command in tru64 4.0g and tru64 5.1 UNIX

We just upgraded our application from tru64 4.0g to tru64 5.1 and we encountered a strange behaviour in one of the shell scripts

Shell script works in two different ways in T4.0g and T5.1.
Note: We use ksh.

Problem can be illustrated using three shell scripts : first.ksh, second.ksh and third.ksh.
first.ksh is the parent shell program.


first.ksh
---------

function1()
{
. second.ksh
}

echo "calling function1"
f = function1
eval $f
echo "end of first shell"


second.ksh
-------------

. third.ksh

echo "i am in second shell script"
endfunction

third.ksh
----------
endfunction()
{
exit
}

If I run first.ksh in tru64 4.0g, I get the output as
calling function1
i am in second shell script
end of first shell

But, if I run first.ksh in tru64 5.1, i get the output as
calling function1
i am in second shell script

That is, in T5.1, after executing second.ksh, it comes out of current shell whereas in T4.0g, it does not. Logically speaking, it should work as in T5.1 since, second.ksh also executes in the same shell as of first.ksh and hence exit should completely terminate.

Does this mean that T4.0g had a bug? Was there any similar problem reported? Or Am I missing any setting anywhere Or is it something else?

Thanks in advance for any kind of reply... Faster replies appreciated.

Thanks and regards
Sandhya
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On