ps -eaf gives inconsistent result

The command ps -eaf gives inconsistent result when executed on XYZ server (the command shows 1, 2 or 3 instances of the process. Ideally it should show only 1). I have attached the script file that was executed and the corresponding output. When the same script was executed on ABC server it gave the desired result.

XYZ : Is a VM instance running Linux (Red Hat Enterprise Linux Server release 5.5 (Tikanga))
ABC : Physical server running Linux (Red Hat Enterprise Linux AS release 4 (Nahant Update 7))

I would like to know that XYZ being a VM instance are there any environmental settings or issues which might result in such a behavior? Any inputs on this are appreciated.

Thanks!!

I dont think the reason for this due to different o.s. actually it can be differ for when used in different shells or shell versions.
Try `which ksh` and compare version of kshs.
In your script, has used pipes. Maybe because of this, cause get different output in debug mode when in some kshs,
it writes as output it with unordered in ksh own internal buffer which probably caughted first command writes firstly it and after then others in pipes commas.

You can try to look output of ksh debug , add `sleep 1` your script after the `ps ..` command.

regards
ygemici