You can check $KSH_VERSION to reliably determine whether this is mksh (or pdksh).