ITEM: I2315L

Unexpected results using the return Korn shell built-in


Question:

AIX Version 3.2.5:

The ksh builtin, return, is not functioning as expected within one
of my ksh scripts.  Here are some example scripts to demonstrate the
problem:  (Note that the scripts that use exit work properly, but
the scripts that use return do not.)

\#!/bin/ksh
\# myexit --> This works.
print "$0[$$]: hello"
$(false || exit)
print "$0[$$]: goodbye(exit $?)"

\#!/bin/ksh
\# myexit2 --> This works.
print "$0[$$]: hello"
$(false; exit)
print "$0[$$]: goodbye(exit $?)"

\#!/bin/ksh
\# myreturn --> Spawns child and hangs.  Ctrl-C breaks out of script,
\#              but child process gets owned by init and is still hung.
print "$0[$$]: hello"
$(false || return)
print "$0[$$]: goodbye(exit $?)"

\#!/bin/ksh
\# myreturn2 --> Spawns child and hangs.  Ctrl-C breaks out of script,
\#               but child process gets owned by init and is still hung.
print "$0[$$]: hello"
$(false; return)
print "$0[$$]: goodbye(exit $?)"

The child processes that are spawned by the scripts that use return
do not die and you can start to accrue a lot of these processes after
a while...

Response:

This is a defect in the Korn Shell and an APAR has been created to
fix this problem.  The APAR number to reference is ix43750.  You may
request this APAR from Software Support at 1-800-237-5511 or call the
AIX Support Line if you are a Support Family customer.  The fix will
be sent to you as soon as it is available for distribution.


Support Line: Unexpected results using the return Korn shell built-in ITEM: I2315L
Dated: May 1994 Category: N/A
This HTML file was generated 99/06/24~13:30:45
Comments or suggestions? Contact us