LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 11:26 AM   #1
jkeertir
Member
 
Registered: Mar 2008
Posts: 70

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, 04: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 04:45 AM.
 
Old 04-09-2008, 06: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:46 PM
CGI shell script (GET/POST?) metalx1000 Programming 1 09-20-2006 08:27 PM
Launch CGI script from shell alex986best Linux - Newbie 2 06-28-2006 07:28 AM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-12-2005 12:08 AM
configuring a cgi shell script to run keeg Linux - Newbie 1 06-09-2005 02:45 PM


All times are GMT -5. The time now is 08:20 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration