interp - Simple Interpreter for Embedded Computers
interp [OPTIONS] [SCRIPT ARGS]
This build of interp
is specifically for POSIX-compatible systems, including embedded linux.
The enviroment-specific features are limited to the command line interface,
and include capabilities that make it easier to use an interpretive language
as one part of a larger entity such as scripts and programs. These features
make it possible to load function definitions from multiple files, pass
one-line command strings, and run in a batch mode (non-interactive.)
- -c commands
Execute a command string ("one-liner") as if it
had been typed at the keyboard, with
this restriction: no outer interpreter
directives ("#" in column one.)
If the interp commands include embedded
whitespace, the whole command string must
be surrounded with quotation marks.
If the command string includes special
characters usually interpreted by the
shell, they must be escaped with "\".
- -f filename
Read commands from the specified file until
the end-of-file (EOF) is encountered. There are no restrictions on the use
of language facilities (directives, macros, and in-line comments are allowed.)
Generally this is the best way to load definitions into interp before the
user gets the prompt.
Allows you to continue executing after an error when
reading redirected input. This option is useful for testing interp.
Stop executing after errors when reading redirected input or when
reading from a file (see "-f" option above.)
Display usage and quit.
Echo any redirected input (or "-c" command strings.)
Request that interp quit after processing all the
command line options. This is non-interactive mode. Because the program
doesn't quit until all the options have
been processed, if this is the first
option, it won't block script arguments.
Disable verbose-style error messages.
Display version and build info and quits.
Enable verbose error messages. Show the segment of code where the error
occurred and other information that may be helpful to script developers.
A list of whitespace-separated arguments that are
to be handled by your interp code.
Individual arguments may be quoted on linux/unix.
Arguments that begin with a dash aren't supported.
Arguments with embedded whitespace must be quoted.
- The command line is processed as written, from left to
to right without being reorganized.
Option flags, if present, must preceed all script args.
The "-f", "-c", "-n", "-C", "-q", and "-v" options may be repeated as many
times as desired, in any order or sequence you like.
Lines echoed by "-l" are preceded by "-->".
Duane L. King, esq. <email@example.com>