Is there an equivalent of $! in ksh, which provides the error string ? $? stores the exit code only.
Unfortunately no. Generally in shell scripting, you can only get back information that the program passes to the environment, which on most unix systems is just the return code. Generally to find out what an error return value means, you will need to look in the manual page for the program which returned an error.
For example, the
In many cases, the error will be printed on STDERR as well.