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.5 Include

The include statement forces inclusion of the named file in that file location:

rule: include file

Include file file.

The statement is evaluated when parsing the configuration file, which means that file undergoes only tilde expansion: the two characters ‘~/’ appearing at the beginning of file are replaced with the full path name of the current user’s home directory.

If file is a directory, that directory is searched for a file whose name coincides with the current user name. If such a file is found, it is included.

In any case, if the file named by file (after tilde expansion) does not exist, no error is reported, and parsing of the configuration file continues.

Before including the file rush checks if it is secure, using the same rules as for the main configuration file (see security checks). The exact list of checks can be tuned using the include-security statement (see include-security).

The include statement can be used only within a rule. The included file may not contain rule and global statements.

This statement provides a convenient way for user-dependent rush configuration. For example, the following fall-through rule (see Fall-through) allows the administrator to keep each user personal configuration in a file named .rush, located in the user’s home directory:

rule user
  include "~/.rush"
  fall-through

Of course, it is supposed that such a per-user file, if it exists, is writable only for super-user.

The use of include files may be especially useful for per-user localization (see Localization). It suffices to provide a fall-through rule, similar to the one above, and to place a locale directive in ~/.rush files, according to the user preferences.

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