GNU Rush – a restricted user shell (split by section):   Section:   Chapter:FastBack: Configuration File   Up: Configuration File   FastForward: Default Configuration   Contents: Table of ContentsIndex: Concept Index

4.1 Syntax

Configuration file consists of statements and comments.

A comment is any line whose first non-whitespace character is ‘#’. Empty lines and comments are ignored.

A statement consists of a keyword and optional argument, separated by any amount of whitespace. Depending on the keyword, the statement may treat its argument as a single value or as multiple values. For example, the command instruction takes a single value as its argument, so parsing the statement

command ^scp -t /incoming/

results in keyword ‘command’ and value ‘^scp -t /incoming/’.

If the keyword requires multiple values, its argument is split into words using the following algorithm:

  1. Any sequence of one or more non-whitespace characters is a word.
  2. Any sequence of characters enclosed in single (‘'’) or double-quotes (‘"’) is a word.
  3. Words are separated by any amount of white space.
  4. If the keyword expects s-expressions (see s-expression), these are treated as words, even if they contain white space.

Arguments, obtained as a result of rules (1) and (2) are subject to backslash interpretation, during which the following escape sequences are replaced with single characters, as described in the table below:

SequenceReplaced with
\aAudible bell character (ASCII 7)
\bBackspace character (ASCII 8)
\fForm-feed character (ASCII 12)
\nNewline character (ASCII 10)
\rCarriage return character (ASCII 13)
\tHorizontal tabulation character (ASCII 9)
\vVertical tabulation character (ASCII 11)

Table 4.1: Backslash escapes

Any escape sequence not listed in this table is replaced with its second character.

Statements are delimited by newline characters. Length of a statement line is not limited. To improve readability, long statements may be split over several lines by using backslash (‘\’) as a last character on line. Thus, the following statement:

usage-error Contact your\
 system administrator

is equivalent to:

usage-error Contact your system administrator

4.1.1 Notes on Quoted Strings

The syntax of GNU Rush configuration file was designed so as to implement minimum amount of syntactic mark up. Most statements treat their argument as a single value, even if it contains embedded white space. However, leading and trailing whitespace is always removed. Consider, for example, the following statement4:

  match[1] ^/sources/[^ ]+\.git$

Here, the argument is ‘^/sources/[^ ]+\.git$’. Note, that you must not quote it, because quotation marks would be considered part of the argument.

There are, however, statements that take several arguments. In these statements, arguments that contain embedded white space must be quoted. For example, in the statement below5 the second argument is a single space character. It is quoted to prevent it from being treated as a delimiter:

  map[0] /etc/passwd.rush " " ${user} 1 7

Notice also, that arguments to these statements are subject to backslash interpretation (see Table 4.1).

The table below lists all statements that take multiple arguments, with cross references to more in-depth explanations in the body of the manual.

user

See user.

group

See group.

transform pattern expr
transform[n] pattern expr

See transform.

map

See map.

env

See Environment.

regexp

See Regex.

include-security

See include-security.

Footnotes

(4)

See match, for information about match statement.

(5)

See map, for a description of map statement.

GNU Rush – a restricted user shell (split by section):   Section:   Chapter:FastBack: Configuration File   Up: Syntax   FastForward: Default Configuration   Contents: Table of ContentsIndex: Concept Index