# options

Many commands take options to modify their behavior, following these rules (similar to UNIX conventions, but not identical):

- All options must be immediately preceded by '-'.
- Options may be grouped after a single '-'.
- Some options may take string, numeric, or time arguments. There must be no space between the option and the argument.
- String option-arguments may be delimited by a space, double quotes, single quotes, or backquotes.
- A literal delimiter character or '\' within a delimited string must be escaped by preceding it with '\'.
- A numeric option-argument may be given as an expression that evaluates to a numeric value. If the expression contains spaces or quotes, they must be quoted or escaped as in a string option-argument.
- All options must precede normal arguments.
- A '-' or '--' by itself may be used to mark the end of the options. This is useful when the first regular argument begins with '-'.
- A '-?' or invalid option will produce a list of valid options.

See also: getopts().

Back to index
Back to tf home page

Copyright © 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2004 Ken Keys