ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: how to request 7250 execute command from external web

To:
Subject: Re: [ts-7000] Re: how to request 7250 execute command from external web browser?
From: Onur T <>
Date: Wed, 18 Jan 2006 15:18:25 -0800 (PST)
Hi,

I have a question about this thread. I have a simple cgi script as follows:

------>
#!/bin/sh
# disable filename globbing
set -f
echo Content-type: text/plain
echo
echo CGI/1.0 test script report:
echo

echo argc is $#. argv is "$*".
echo

echo MY PROGRAM
stest
-------------->

My problem is While my program stest is called in this script and it runs, the output of the program is never displayed on the webpage. Why is that? Is it because I am using printfs in my program that I don't see the output?

How can I interface the output of my program to the cgiscript without having to write to files.

Also is there an easier way to do this? i.e. have the output of C programs in an html document?






Jim Jackson <> wrote:


On Wed, 18 Jan 2006, chentom60 wrote:

> Also, I heard python is more simpler and more powerful than Perl. Is
> it true?

Apples and Oranges -which is the best fruit?
I'd argue that for general scripting purposes then Perl is the most
powerful scripting language there is, but if you are designing a large
user application then maybe it isn't appropriate.

> I would appreciate if anyone would give me some explaination.

Try googling - there is tons of stuff out there.

For many simple purposes your best scripting language is just sh.

As an example I've attached a simple shell script that acts as
a web browser. I call it webserv.sh

Install the shell script in a directory - say /usr/bin
make sure it is executable

  chmod 755 /usr/bin/webserv.s! h

edit /etc/inetd.conf and add a line like.....

webcache        stream  tcp     nowait      root /usr/bin/webserv.sh webserv.sh

then find the process number of your inetd process

  ps | grep inetd

    333 root        596 S   /usr/sbin/inetd
   4560 arm         428 S   grep inetd

Then send the inetd process a HUP signal make it reread the config file

  kill -HUP 333

Then you should have a "webserver" listening on the webcache port (8080)

assuming your ts7200 has the address 192.168.0.50, point a web browser
at

http://192.168.0.50:8080/hello

     a simple fixed hello page
http://192.168.0.50:8080/usage

     an example of executing commands and use of refresh

http://192.168.0.50:8080/fred

     example of a 404 simple page for a non existant page

http://192.168.0.50:8080/jj

     an example of a redirect - if you browser has internet access, you'll
     end up at my webpage :-)


The script is only 100 odd lines and is very easy to follow and to
customise for your own usage.

Who needs apache :-)

Jim



Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.

YAHOO! GROUPS LINKS

  •  Visit your group "ts-7000" on the web.
     
  •  To unsubscribe from this group, send an email to:
     =Unsubscribe
     
  •  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU