[Newlug] Linux batch script question

Bernard Starzewski bernard_starzewski at yahoo.com
Sat Apr 9 16:34:47 UTC 2011


The environment for the apache user is not fully defined for the logicals used by the script.
I didnt see it but that is probably what that .bat file is supposed to be doing.
Take a hard look at it to make certain that it is running and that the logicals there are consistent with your directory structure.

--- On Sat, 4/9/11, Mike Schwartz <mschw at athenet.net> wrote:

> From: Mike Schwartz <mschw at athenet.net>
> Subject: Re: [Newlug] Linux batch script question
> To: newlug at newlug.org
> Date: Saturday, April 9, 2011, 11:27 AM
>      Yes, the
> scripts are executing.  It starts to create a .PDF
> file, but the scripts are putting the .PDF into the wrong
> subdirectory, so when it sends the next URL to the user,
> they get a ".PDF file not found" error.
> 
> Thanks,
> 
> Mike
> 
> > -----Original Message-----
> > From: newlug-bounces at newlug.org
> [mailto:newlug-bounces at newlug.org]
> > On Behalf Of Bernard Starzewski
> > Sent: Saturday, April 09, 2011 11:19 AM
> > To: newlug at newlug.org
> > Subject: Re: [Newlug] Linux batch script question
> > 
> > Are you sure that the apache user id has execute
> access to all of the scripts?
> > 
> > --- On Sat, 4/9/11, Mike Schwartz <mschw at athenet.net>
> wrote:
> > 
> > > From: Mike Schwartz <mschw at athenet.net>
> > > Subject: Re: [Newlug] Linux batch script
> question
> > > To: newlug at newlug.org
> > > Date: Saturday, April 9, 2011, 8:15 AM
> > >      Thanks,
> > > Ben!  That's what I couldn't think of
> yesterday - piping the input to
> > > the script!  I'll try that this morning...
> > >
> > > Mike
> > >
> > > > -----Original Message-----
> > > > From: newlug-bounces at newlug.org
> > > [mailto:newlug-bounces at newlug.org]
> > > > On Behalf Of Ben DuPont
> > > > Sent: Friday, April 08, 2011 7:14 PM
> > > > To: newlug at newlug.org
> > > > Subject: Re: [Newlug] Linux batch script
> question
> > > >
> > > > Like others have mentioned, a CGI program
> looks for
> > > POST data on stdin.
> > > > That's why the script is hanging.  Try
> this:
> > > >
> > > > echo
> > >
> "ctlrec=749&ctlval=3556&tcode=+4617780+&oldcrec=76149
> > > > +&reference=INVO2233" | ./geninvo.cgi
> > > >
> > > > If that doesn't work, you might have to
> force an EOF
> > > character:
> > > >
> > > > echo -e
> > >
> "ctlrec=749&ctlval=3556&tcode=+4617780+&oldcrec=76149
> > > > +&reference=INVO2233\0032" |
> ./geninvo.cgi
> > > >
> > > > You might also have to add the -n option to
> remove the
> > > new line character.
> > > >
> > > > Ben
> > > >
> > > > On Fri, 2011-04-08 at 09:39 -0500, Mike
> Schwartz
> > > wrote:
> > > > >      I’m trying to
> debug a
> > > script that is called from a web site and
> > > > > spits back a .PDF file after the user
> clicks on
> > > the invoice number he
> > > > > wants to see.
> > > > >
> > > > >
> > > > >
> > > > >      The following
> script, named
> > > genpod.cgi, is on a Linux box and is
> > > > > supposed to be able to be run from the
> command
> > > line after setting
> > > > > QUERY_STRING to the following value:
> > > > >
> > > > >
> > > > >
> > > > > mike:>   export
> > >
> QUERY_STRING=’ctlrec=749&ctlval=3556&tcode=+4617780
> > > > >
> +&oldcrec=76149+&reference=INVO2233’
> > > > >
> > > > >
> > > > >
> > > > >
> mike:>   ./geninvo.cgi
> > > > >
> > > > >
> > > > >
> > > > >      However, the script
> seems to
> > > hang up at the “cat >$FPWP2” line.
> > > > > It never creates the .out, .err, etc.
> output
> > > files.
> > > > >
> > > > >
> > > > >
> > > > >       My
> question
> > > is:  what is the “cat” command actually
> > > > > concatenating at this point?  Is
> it
> > > expecting another $1 parameter
> > > > > after the ./geninvo.cgi command?
> > > > >
> > > > >
> > > > >
> > > > > Thanks!
> > > > >
> > > > >
> > > > >
> > > > > Mike Schwartz
> > > > >
> > > > >
> > > > >
> > > > > ----- -----
> ----------------------------------
> > > > >
> > > > > #!/bin/sh
> > > > >
> > > > >
> > > > >
> > > > > umask 0
> > > > >
> > > > >
> > > > >
> > > > > FPWSYS=$$
> > > > >
> > > > > FPWP2=/tmp/fpwp2.$$
> > > > >
> > > > > export FPWSYS FPWP2
> > > > >
> > > > >
> > > > >
> > > > > . ./setglobal.bat
> > > > >
> > > > >
> > > > >
> > > > > cat > $FPWP2
> > > > >
> > > > > echo >> $FPWP2
> > > > >
> > > > >
> > > > >
> > > > > > /fpmerge/$$.out
> > > > >
> > > > > > /fpmerge/$$.err
> > > > >
> > > > > > /fpmerge/$$.frm
> > > > >
> > > > > > /fpmerge/$$.pcl
> > > > >
> > > > > > /ptmp/${FPWSYS}.pdf
> > > > >
> > > > >
> > > > >
> > > > > #############  main  ##
> > > > >
> > > > > (other commands snipped…)
> > > > >
> > > > >
> > >
> > >
> > >
> 
> 


More information about the Newlug mailing list