How can I catch the status of an inner pipe command .
example :

< cmd 1 > | < cmd 2 >

in this case the return value of this pipe command is the return value of the last
command ( cmd 2 )

How can I get the return value of cmd 1 ?

Actually ,it is the same as PIPESTATUS[] in bash.
but how can I do it in KSH ?