[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-newbie
Subject:    Re: error: premature end of script headers in cgi
From:       John Kelly <bilbo () waitrose ! com>
Date:       2004-08-31 22:02:53
Message-ID: 20040831230253.4c8c6091.bilbo () waitrose ! com
[Download RAW message or body]

Hi,
On Tue, 31 Aug 2004 10:47:44 -0400
"William Stanard" <wstanard@palmertrinity.org> wrote:

> I'm running Linux 2.4.18-14smp on a Compaq Proliant. When trying to
> run gm.cgi (correctly chmod-ed, I believe) to start using Greymatter
> blogging, I receive the following error when I look at the httpd
> error_log:
> 
> [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...
> 
There are a few methods to see non printing characters in a file.
Try 
cat -v filename 

In vi, in command mode you can do:
: set list
and all the 'funny' characters will be displayed.
Do:
: set nolist 
to make the file appear normal.

Personally whenever I come across an MS-dos file on Unix, I first
check it in vi with the :set list command and then I do a vi command
like:

:%s/<CTRL>v<CTRL>M//g

This is a substitute command. 
The % sign means apply the command to the whole file
s means substitute.
/ is the delimiter
<CTRL>v means dont interpret the next keystroke
<CTRL>M is the 'funny' character you want to get rid of. In this case
it is control M, though you may find something else in your
particuliar file. g means do the command globally ie do it as many
times as necessary on each line.

Of course if it all goes wrong, you can type u in command mode and the
change will be undone :-)

Hope this helps.

regards,

John Kelly


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic