Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run ksh script from CGI

Status
Not open for further replies.

danhodges99

IS-IT--Management
Feb 6, 2003
21
GB
Howdy,

I'm developing a system which requires me to run a ksh script from within a cgi script. What sort of syntax will I need to do this, I'm sure it's simple but can't find out how anywhere!

Thanks.
 
Hello,
The secret to cgi programming is that the output of your program or script must be in html format and thus create an html document. Compared to normal scripting, you will printf lots of html markup code which would otherwise be unnecessary to the operation of the script.
I've written several script systems in Bourne using this approach and it works just fine. Of course, if you are calling this Korn script from another program it might complicate things a little, but the general rule I use is that I'm creating a sequential file which outputs to standard output.
If you need to see error output generated by the script, it will appear in the error log for the web server, or if you want to see it in the document, then make sure to redirect it to standard output.
Also remember to put the script in the cgi-script directory or the web server won't invoke it. This location is defined in the configuration file of the web server and the web master can tell you this information.

Hope this helps!
Charlie Ehler
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top