#!/bin/ksh
# runs a given commandline and outputs its exit code to
# a file (useful for running inside processes that ignore
# exit codes, such as dtterm -e)
#  @(#)exitwrapper	1.7 98/08/13 19:01:14  

cmd="$1"
returnfile="$2"

ksh -c "$cmd"
s=$?
if [ -n "$returnfile" ] ; then
    echo $s > $returnfile
fi
