Got it - ksh93 is an "add-on" not part of the HPUX standard distribution, AFAIK. For our HPUX boxes we get support only on sh and ksh. YMMV.
I believe you have a shell problem. The examples I gave you and the examples you gave me that failed are POSIX compliant and should work in a POSIX shell. I don't know how you'd get support from HP -- which is where I would start in another circumstance.
If you cannot get support, try /usr/bin/ksh Your examples should never coredump.
The first thing i notice is a problematic usage of the "print"-statement. The reason is, that "print" awaits one or more parameters and is satisfied with getting one. That may - depending on the variables contents - lead to unexpected results, like in this example:
function write_log
{
print $*
}
# ======= first example ======
a="hello there"
b="; exit"
write_log $a $b
# ====== second example ======
a="-u2"
b="hi there"
write_log $a $b
In the first example the script will terminate because the expanded line reads "print hello there ; exit" and "exit" is a shell command. In the second example "-u2" is interpreted as an option to print instead of printable text. Maybe something along these lines has happened and is responsible for the coredump?
btw. the solution to the print-command being a bit ambigous is:
print - "$*"
After the dash everything is considered to be printable text and the double quotes around the variable take care that only one parameter is given to print.