CGI scripts in CSH or TCSH

CGI scripts in CSH or TCSH

Post by The Nemasy » Fri, 02 Jan 1998 04:00:00




> I wrote a test CGI script in sh to print Hello world in sh.  It works
> well. When I changed sh to csh or tcsh, some error happens, Does any
> one has experience on writing CGI script in csh or tcsh? Could you
> please give me a "hello world" example in csh or tcsh? Thank you very
> much!!

And the error message was....

--
Nemasys Technologies                Enchanted Worlds - Free Web Chat
http://www.nemasys.net/             http://www.nemasys.net/chat/

 
 
 

CGI scripts in CSH or TCSH

Post by Yongxing L » Sat, 03 Jan 1998 04:00:00


Hi, Everyone,

I wrote a test CGI script in sh to print Hello world in sh.  It works
well. When I changed sh to csh or tcsh, some error happens, Does any
one has experience on writing CGI script in csh or tcsh? Could you
please give me a "hello world" example in csh or tcsh? Thank you very
much!!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Yongxing Liu
Department of Chemistry
Wesleyan University
Middletown CT 06459


URL:    http://linus.chem.wesleyan.edu/yliu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 
 
 

CGI scripts in CSH or TCSH

Post by Zuo Dong Zhen » Sat, 03 Jan 1998 04:00:00


Quote:>please give me a "hello world" example in csh or tcsh? Thank you >very

much!!

#!/bin/csh
echo "hello world"

END OF SCRIPT

zuodong.

 
 
 

CGI scripts in CSH or TCSH

Post by Yongxing L » Sun, 04 Jan 1998 04:00:00


On Fri, 2 Jan 1998 23:43:22 -0800, "Zuo Dong Zheng"

Thanks a lot, maybe I didnot make myself clear, I need a sample for
CGI script in csh or tcsh.

I wrote one in sh before,
#!/bin/sh

echo "content-type html/text"
echo " "
echo " "
echo "Hello World"

and it works. But when I changed to csh or tcsh. Some error message
happens to the WWW server( I am using IRIX 6.2).

Does anyone has any experience writing CGI scripts in csh or tcsh? (
theoritically it should be no difference if you use sh, tcsh, csh,
perl or python)

Thanks

Quote:

>>please give me a "hello world" example in csh or tcsh? Thank you >very
>much!!

>#!/bin/csh
>echo "hello world"

>END OF SCRIPT

>zuodong.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Yongxing Liu
Department of Chemistry
Wesleyan University
Middletown CT 06459


URL:    http://linus.chem.wesleyan.edu/yliu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 
 
 

CGI scripts in CSH or TCSH

Post by Hovis Andronicu » Tue, 06 Jan 1998 04:00:00


Greetings,

I'll admit that I'm not using IRIX, rather HP-UX 10.2 and BSD/OS 3.1 -
both systems running Netscape Fasttrack server as the http server.

Anyway, try this:

#!/bin/csh

echo "Content-type: text/html"
echo ""
echo " "
echo "Hello World"

Anyway...I couldn't get the example you've given with /bin/sh to run
from a browser.

There needs to be a blank (empty) line sent to terminate the http
response header, not a line with a whitespace character in it.  Also
note the format of the "Content-type" header line.

The error message that appeared in my log file looked something like
this:

failure: for host * trying to GET /cgi-bin/testhw, cgi-parse-output
reports: the CGI program /path/to/cgi-bin/testhw did not produce a valid
header (name without value: got line "content-type html/text")

Then, after changing the content-type header line:

failure: for host * trying to GET /cgi-bin/testhw, cgi-parse-output
reports: the CGI program /path/to/cgi-bin/testhw did not produce a valid
header (name without value: got line " ")

This happened with both /bin/sh *AND* /bin/csh - in other words, the
shell was irrelevant.

Hope this helps.


> On Fri, 2 Jan 1998 23:43:22 -0800, "Zuo Dong Zheng"

> Thanks a lot, maybe I didnot make myself clear, I need a sample for
> CGI script in csh or tcsh.

> I wrote one in sh before,
> #!/bin/sh

> echo "content-type html/text"
> echo " "
> echo " "
> echo "Hello World"

> and it works. But when I changed to csh or tcsh. Some error message
> happens to the WWW server( I am using IRIX 6.2).

> Does anyone has any experience writing CGI scripts in csh or tcsh? (
> theoritically it should be no difference if you use sh, tcsh, csh,
> perl or python)

> Thanks

> >>please give me a "hello world" example in csh or tcsh? Thank you >very
> >much!!

> >#!/bin/csh
> >echo "hello world"

> >END OF SCRIPT

> >zuodong.

> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

> Yongxing Liu
> Department of Chemistry
> Wesleyan University
> Middletown CT 06459


> URL:    http://linus.chem.wesleyan.edu/yliu
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%