2. Command-Line Usage

Syntax

smx -e expression : Evaluate expression as an SMX function
smx [-c] filename : Open file and parse, optionally add CGI headers [-c].

Description

SMX can be an excellent embedded expression application for your software. Use it to add inline expression evaluation to your batch files, and process control, or to include within an application.

Command-line arguments can be retrieved with %arg(<integer>), the number of arguments is in %num-args%.

Example

-- return the contents of the SMX language main web site

smx -e '%include(http://www.smxlang.org/)'

-- as a cgi, display all browser headers

#!/usr/bin/smx -c
<pre>
%enumheader(%header% %value% %lf%)
</pre>