Unix Shell Scripting/Running shell script from a web browser
I have some Unix Shell Script that needs to be made to run from a web browser. Since many users do not want to use command line interface, I need to build a graphical user interface that will run this Shell Script.
Any information regarding this would be much appreciated.
Given that the web server is set up to allow CGI scripts (most are),
the steps are as follows:
1. Use a shebang on the first line of the script that tells the server
what shell to use to run the script. For example, it could be one of
2. Send a header declaring what type of output the script creates.
Usually this is HTML. The header must be followed by a blank line:
printf "Content-type: text/html\n\n"
3. Make the script executable, but not writable by anyone other than
the owner of the script:
chmod 755 /path/to/script
4. Install the script in a directory on your web site.
5. Test the script. For testing, it is often useful to redirect the
standard error, either to a file, to the web page it produces, or to
the bit bucket:
exec 2>error-log ## file
exec 2>&1 ## the web page
exec 2>/dev/null ## discard all error messages
An example of a simple CGI script can be seen at