The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Executing scripts in Parallel itsme_maverick Shell Programming and Scripting 2 06-06-2008 12:23 PM
Running shell scripts from web browser corleone Shell Programming and Scripting 7 08-01-2006 12:11 AM
Executing Shell Scripts BuyoCat UNIX for Dummies Questions & Answers 1 09-07-2005 02:11 AM
executing variables in ksh scripts? zedmelon Shell Programming and Scripting 3 08-06-2003 02:50 PM
executing perl scripts vtran4270 UNIX for Advanced & Expert Users 2 08-27-2002 03:28 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-28-2008
jefinah jefinah is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 1
executing shell scripts in a browser

Hi all Im a newbie in shell scripting, i found it joyous creating simple adminitrative scripts, like adding users, modify and delete, remote sw install etc, now i want to intergrate my scripts to make a simple administrative tool, how do i access the scripts via a browser is it possible??

please help
  #2 (permalink)  
Old 10-28-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,927
Yes, it is possible, but generally your web server must be configured to permit it.

For example, if you are using the Apache web server, it must be configured with cgi access so that files in the cgi-bin directory are treated as apps and run by the server when requested rather than as documents.

You also must modify your shell script to output the correct MIME type and html code.

Here is a simple example to output today's date:
Code:
#!/bin/ksh
DATESTR="$(/bin/date)"
echo "Content-type: text/html"
echo ""
echo "<html><head><title>Todays Date</title></head><body>"
echo "<p>Today is ${DATESTR}</p>"
echo "</body></html>"
  #3 (permalink)  
Old 10-28-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
You can call shell commands and scripts via php/perl/cgi scripts via web a server.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0