#!/bin/sh -x printf "Content-type: text/plain\n\n" exec 2>&1 ./your_script.cgi echo "Exit status: $?"