Operating System - Linux
1748054 Members
4709 Online
108758 Solutions
New Discussion юеВ

Re: Unix shell script CGI

 
SOLVED
Go to solution
Rob Daniels
Advisor

Unix shell script CGI

Hi all,
when I login as root on our hp9000, and execute the script test to print a file, it works fine
#!/bin/sh
export PRINTER=lj402
if [ -s outsam.9001 ] ; then
lp outsam.9001
fi

When I post execute the above script by a html screen as a cgi script, it won't print anything.

Can anyone help me out please.

Thank you in advance.
3 REPLIES 3
Torsten.
Acclaimed Contributor
Solution

Re: Unix shell script CGI

Check the error logfile.
I would use the full pathname, /usr/bin/lp

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Rob Daniels
Advisor

Re: Unix shell script CGI

It works. Thank you!!

That was easy, I should have know that.

Thank you again.
Rob
Steven E. Protter
Exalted Contributor

Re: Unix shell script CGI

Shalom,

You need a statement at the top to set the print type for html.

In perl it looks like this:

print "Content-type: text/html\n\n";


echo -e "Content-type: text/html\n\n"

Should work or two line feeds after the html.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com