Re: error: premature end of script headers in cgi

Peter Garrett
2004-08-31T21:04:02Z

On Wed, 2004-09-01 at 00:47, William Stanard wrote:

>
> [error] [client 10.0.4.126] Premature end of script headers: gm.cgi
>
> I am guessing that in moving the cgi scripts to my Linux box via
> Dreamweaver, I "added" some bogus carriage returns or some such... How can
> I (first) see if that is what I did and (two) edit same...

Bill: I'm no expert, and perhaps someone more knowledgeable might be
able to explain better, but I believe your guess may be correct. The
carriage returns for DOS/Windows are different from those in UNIX (which
Linux more closely resembles, of course.)

The program you want is probably the command-line utility dos2unix.
Seems to be pretty standard on most Linux installations. From "man
dos2unix":

" tofrodos - Converts text files between DOS and Unix formats.

SYNOPSIS
fromdos [ options ] [file...]
todos [ options ] [file...]

DESCRIPTION
DOS text files traditionally have carriage return and line feed
pairs
as their newline characters while Unix text files have the line
feed as
their newline character. fromdos converts text files from the
DOS for-
mat to the Unix format, while todos converts text files from
the Unix
format to the DOS format. ...."

Hope this helps...

Peter

--
Windows belongs to Microsoft: Linux belongs to humanity