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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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? |
|
|||
|
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/ |
|
|||
|
-----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----- |
|
|||
|
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/ |