The UNIX and Linux Forums  

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
passing variable from bash to perl from bash script arsidh Shell Programming and Scripting 10 06-04-2008 01:25 PM
Why generate "ash and bash" different output for same bash script? s. murat Shell Programming and Scripting 0 05-26-2008 08:19 AM
Wrapping Your Brain Around Oracle + Python iBot Oracle Updates (RSS) 0 04-06-2008 06:10 AM
Wrapping ksh script nir_s Shell Programming and Scripting 2 05-30-2006 03:37 AM
Line wrapping problem when using awk placroix1 Shell Programming and Scripting 1 05-10-2005 12:44 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-11-2003
andyj andyj is offline
Registered User
  
 

Join Date: Jul 2003
Location: UK
Posts: 27
Wrapping a bash script for CGI

I hope its ok to start a new thread, I was going to use my existing one but thought a new one would better clarify things and provide better search for future reference.

Well I have my bash program working now, all nice, user input validated, output formatted, everything is looking sexy.

Now the guys tell me that they don't want telnet access to the server, grrrrrrr! I have to make
an idiot proof web interface.

So I need to choose a way to go. As I see it I can either re-write the whole thing in perl or
somehow 'wrap' my bash into a cgi interface.

I've been thinking about the latter option and it seems non-trivial to me at this stage. On the face of it my thinking goes something like this pseudocode:

1) Spawn a copy of my bash script and background it&
while[1] do
2) Take the standard output of the script and redirect it to a little HTML wrapper something like
echo "content-type: text\/html \<html\> <body>
$MYSTDOUTHERE \</html\>\</body\>"
3) process a POST request and send the relevant data to my backgrounded script
done

While I can express the concept clearly enough (I hope) the details are a bit fuzzy and I would welcome any input or comments before getting started. Is such a method possible/reliable/secure?
The web interface would only be used by trusted administrators but I am worried enough about 'command substitution' in any situation where CGIs are involved, its my natural paranoid stance
all best regards
Andy
 

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:29 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