LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-09-2008, 10:26 AM   #1
jkeertir
Member
 
Registered: Mar 2008
Posts: 75

Rep: Reputation: 15
cgi shell script


Dear all,

I am using shell script as cgi program.I want to return back to the html page from cgi program again.or call other html page and diplay the ccontect of the file in html page.

how can i also display the content of the crontab -l output in tabular format in html page.

Please can anyone help me to solve the issue.

With Regards,
Keerti
 
Old 04-09-2008, 03:59 PM   #2
marquardl
Member
 
Registered: Apr 2008
Posts: 100

Rep: Reputation: 15
Bash PHP HTML

You cannot embed shell scripts into HTML, at least not without programming your own apache module to do so.

When your shell script is called it has to provide all the HTML output by itself.

Other possibility is to embed PHP scripts within the HTML page and call from within PHP the shell script like:
Code:
system (". my_script.sh");
The same for 'crontab -l': open a pipe in PHP from within a table definition.

It also works the other way around: call PHP routines from within your shell script to do the HTML output and mix it with Bash statement. PHP must be CLI-enabled for this.

An excellent opportunity to do a lot of tests and waste a lot of time.

Is there any specific reason why you want to use shell scripting on a web server?

And don't forget the double linefeed after the HTTP header when producing HTML pages in shell scripts.

Bye,
M

Xen in Hardy

Last edited by marquardl; 05-01-2008 at 03:45 AM.
 
Old 04-09-2008, 05:59 PM   #3
jimbo1708
Member
 
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154

Rep: Reputation: 31
php also permits
Code:
<?php
     shell_exec("touch myfile.txt");
?>
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cgi shell script: ssh not working kitmui Programming 2 04-21-2010 02:46 PM
CGI shell script (GET/POST?) metalx1000 Programming 1 09-20-2006 07:27 PM
Launch CGI script from shell alex986best Linux - Newbie 2 06-28-2006 06:28 AM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
configuring a cgi shell script to run keeg Linux - Newbie 1 06-09-2005 01:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration