is there a standard way to detect if script is being run as a cgi script or from the command line. I am creating a script that can be run from both and obviously want the cgi to output HTML but the cammnd line to print text. Michael