Re: Running external programs via cgi script
On Mar 18, 2:32 am, Michael Vilain <vil...@NOspamcop.net> wrote:
> In article
> <8efc5501-7f65-48bb-abfb-ed38e738a...@e10g2000prf.googlegroups.com>,
>
>
>
> newbiegalore <banerjee.anir...@gmail.com> wrote:
> > Hello all :-),
> > I am fairly new to writing CGI code using shell scripts. I have put
> > up a site which takes an input via a form and checks a pgsql db for
> > the matching entry and returns the associated fields for that. I want
> > that if that entry is not found in the db I should be able to populate
> > the db in real-time by running another shell script.
>
> > I added the second program in the cgi-bin folder (sec.sh) and then
> > tried to run it from my main cgi script. It seems that this program
> > just does not run. The code works OK as I have tested on my local
> > machine, I have set the permissions to 755, changed extension to .cgi
> > as well and have tried to get it to work. Even if sec.sh has just echo
> > "hello" > $wd/output , I can see the output file but there is nothing
> > in it!!!
>
> > Am I missing something crucial regarding what can be executed in the
> > cgi-bin directory? Any advice would be very ful.
>
> > Thanks,
> > -A
>
> > Extra information: Hosting agency: Hostmonster.com
> > the sec.sh will ideally contain a wget command and some awk. Awk and
> > wget are installed on the linux system of the hosting provider.
>
> You're using the Borne shell to try and populate a database? Well, I'm
> sure it can be done, but you might check on other tools like maybe perl
> to do this task. There's even CPAN modules you can install do do CGI
> and database access directly from perl. And string manipulation is
> built-in.
>
> It's like you asked how to do a database program in FORTRAN IV. Sure,
> it can be done, but it's way easier to do it in other, more modern
> languages.
>
> Why did you choose the shell?
>
> --
> DeeDee, don't press that button! DeeDee! NO! Dee...
Well I like using shell scripts and I am just starting out with Perl.
I chose the shell because I wanted to get a prototype up and running
before I shift to Perl. :-)
|