csh cgi script gives malformed header

This is a discussion on csh cgi script gives malformed header within the Linux Web Servers forums, part of the Web Server and Related Forums category; I am using apache 2.0.47 on HP-UX 11.0. I am trying to run a simple csh ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-05-2003
Ken
 
Posts: n/a
Default csh cgi script gives malformed header

I am using apache 2.0.47 on HP-UX 11.0.

I am trying to run a simple csh unix script as a cgi in the
ScriptAlias directory /apache2.0.47/cgi-bin

When it runs I get this in the error_log:

[Wed Nov 05 11:58:06 2003] [error] malformed header from script. Bad
header html>: simple.csh

The script is very simple and contains:

#!/bin/csh
echo "Content-type: text/html"
echo
echo "<html><body>"
echo "<BLOCKQUOTE><PRE>"
env
echo "</PRE></BLOCKQUOTE>"
echo "</body></html>"

File permissions etc have all been checked.

Change the first line to #!/bin/sh and magic it works!
Perl scripts work fine too.
Curious to know why mod_cgi is treating csh differently?
  #2 (permalink)  
Old 11-06-2003
David Efflandt
 
Posts: n/a
Default Re: csh cgi script gives malformed header

On 5 Nov 2003 04:31:46 -0800, Ken <ken.weir@roche.com> wrote:
> I am using apache 2.0.47 on HP-UX 11.0.
>
> I am trying to run a simple csh unix script as a cgi in the
> ScriptAlias directory /apache2.0.47/cgi-bin
>
> When it runs I get this in the error_log:
>
> [Wed Nov 05 11:58:06 2003] [error] malformed header from script. Bad
> header html>: simple.csh
>
> The script is very simple and contains:
>
> #!/bin/csh


In FreeBSD or NetBSD it is /bin/csh, but in Solaris and Linux it is
/usr/bin/csh. Where is csh in HP-UX?

--
David Efflandt - All spam ignored http://www.de-srv.com/
  #3 (permalink)  
Old 11-06-2003
Keith Keller
 
Posts: n/a
Default Re: csh cgi script gives malformed header

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2003-11-06, David Efflandt <efflandt@xnet.com> wrote:
>
> In FreeBSD or NetBSD it is /bin/csh, but in Solaris and Linux it is
> /usr/bin/csh. Where is csh in HP-UX?


Which linux are you using? On YellowDog 3.0 and RedHat 7.3 and 9
/bin/csh is a symlink to /bin/tcsh.

- --keith

- --
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/qc6ghVcNCxZ5ID8RArQiAKCWAW4ALcQExJ7zm3/aaphdKmF6kgCglG0z
ycaRRGX7Py8UbaFIAm7JCr4=
=BFdN
-----END PGP SIGNATURE-----
  #4 (permalink)  
Old 11-07-2003
David Efflandt
 
Posts: n/a
Default Re: csh cgi script gives malformed header

On Wed, 5 Nov 2003, Keith Keller
<kkeller-usenet@wombat.san-francisco.ca.us> wrote:
> On 2003-11-06, David Efflandt <efflandt@xnet.com> wrote:
>>
>> In FreeBSD or NetBSD it is /bin/csh, but in Solaris and Linux it is
>> /usr/bin/csh. Where is csh in HP-UX?

>
> Which linux are you using? On YellowDog 3.0 and RedHat 7.3 and 9
> /bin/csh is a symlink to /bin/tcsh.


So it is. I guess I was going by the one from 'which csh' (first in my
PATH).

In Linux: /usr/bin/csh -> ../../bin/tcsh and /bin/csh -> tcsh
In Solaris: both /usr/bin/csh and /bin/csh are same binary (or hard link).

But since the original posted CGI works on both of those, I wonder if the
original poster composed that script in Windows and transferred it as
binary (instead of as ascii text). For example if the script was edited
from /bin/csh to /bin/sh using pico, that would have automatically removed
any troublesome DOS carriage returns.

--
David Efflandt - All spam ignored http://www.de-srv.com/
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:58 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0