Available/Macros

The following macros can be used when constructing bash scripts:

@bashCgiBegin("CVSID","DATE","TITLE",["MIME_TYPE"])

This macro needs to be at the start of the CGI script. It generates the necessary HTML output for the start of the document produced. The CVSID corresponds to the CVS keyword Id (enclose with dollar signs). The DATE should be the date the script was initially created in the form of YYYY-MM-DD. The TITLE should be a short title to go with the page. The MIME_TYPE parameter is optional and if omitted defaults to text/html which is what you'll want 99% of the time.

@bashCgiEnd()

This macro needs to be at the end of the CGI script. It generates the standard HTML output to end the page.

@bashCgiOutBegin()

This macro can be inserted at any point within the script when you want to insert a block of HTML text to be put out to the user (it inserts cat <<EOF into the script). When you are within a @bashCgiOutBegin()/@bashCgiOutEnd() block, you are free to include HTML output, the output of commands (by enclosing in $() like $(date)) or any of the standard @macro() commands - there are way to many to list here. You will need to be careful if you need to output either the dollar sign ("$") or at symbol ("@") - trial and error may be needed (try "\$" and @quote("@")).

@bashCgiOutEnd()

This macro marks the end of a section of HTML output that was inserted into the body of the script. It inserts the text EOF into the script, which means that it needs to be left aligned (unfortunately, I don't think you can indent this).

@runCommand("CMD")

This macro inserts the necessary code into your script to show both the invocation of CMD and the output (normal and error output). The information will be shown in what appears to be a separate window (it looks good - trust me). It should be noted that 2>&1 is appended to the end of the invocation of CMD (so, don't try to redirect standard error yourself). This macro is only useful for commands that don't require user interaction and dump their results to the standard output and error devices.