tags:

views:

56

answers:

2

Hi,

I made a awk script to do stuff on some input files but as I want to avoid installing gawk on the windows machines I want this awk script to be available as a webservice or just a form where I can either upload a file or just copy the text of the file in a box and run the script on it and get back the result of the awk script.

How can I do this.

A: 

Do you really want to make the system() function available to remote machines? I think not.

Ignacio Vazquez-Abrams
+2  A: 

my suggestion, set up a web server, create a form using PHP (or your fav language). At the back end, you can either make a system call to gawk binary OR you can recode your gawk script using PHP(or your favorite language). Then all users will just need to go to the web page and submit their files for parsing. You only need to have one copy of gawk interpreter at your server.

ghostdog74
Do make sure to sanitize the script first, since gawk contains many ways of accessing the filesystem.
Ignacio Vazquez-Abrams
While there are still some potential vulnerabilities, I think the OP is talking about accepting text files for parsing **by** the script rather than accepting arbitrary scripts to be run on the server (which **would** be dangerous).
Dennis Williamson