![]() dynamic content system |
Namemidriff - command line script interpreterSynopsismidriff options scriptfile [varvalue-pairs]DescriptionThe midriff utility executes scriptfile and writes the results to standard output. The midriff utility may be used as a template processor to generate a document in one pass, or it may be used as a filter, to generate results based on an input stream of records. For CGI uses, the similar mrcgi program should be used instead.scriptfile should be a script following the midriff script syntax The midriff command line utility supports all directives except those that are specific to CGI and CGI forms.
The order of command line arguments matters; options should come first,
then the scriptfile, then any varvalue-pairs.
Options-dp
-f
-u
-n
-h
-H
-o
-s
-d
-t
-ver or -?
Varvalue pairs
These may follow the scriptfile on the command line.
The varvalue pair sets the given variable to the given value
before invoking the script. Example: ID=0202
Exit codeThe #exit directive may be used to generate a midriff exit code which can be captured by the invoking shell.Special variables and operatorsThe variable _PRINTDATA is pre-declared. Your script can set it to 1 if you wish to print the input record selectively.If you are using midriff to process data records, you can use constructs such as @1 or @12 to access incoming data fields. You can also set these fields, eg. #set 7 = hello.
The special operator <line> may be used to print an input data record verbatim.
It must be used at the beginning of the line, and must be alone on the line.
This may be useful when processing white-space formatted data, or when it is
desired to print an entire data record to stdout, without having to enumerate all
the fields. Normally, incoming
data is parsed into fields which makes it impossible to preserve space formatting.
The <line> operator gets around this problem.
EXAMPLES1. Execute the script myfile.script. The variables ID and CLINIC would be defined and set to the given values before executing the script. The script retrieves related data (a name) for presentation, using $dba_get().
2. Read a stream of records having field names in the first line (header), and produce a brief report for each record:
NOTESDirectives that are not recognized will be ignored and echoed to standard output, unless -d is used.
#cgivar variables may be set from the command line as var-value pairs.
ENVIRONMENT
SHSQL_DB = the full path name of the project directory containing a
config file.
This is generally optional.
SEE ALSOmrcgi - a version of midriff designed to run in cgi mode, with support for things like CGI forms.
|
![]() dynamic content system Copyright Steve Grubb |