RUSH.RC(5)

NAME
rush.rc - configuration rules for rush.

DESCRIPTION
The file /etc/rush.rc contains a set of rules that the rush (8) shell uses in order to determine whether the user is allowed to execute the requested command and to set up the environment for its execution.

Empty lines are ignored. Lines beginning with a pound sign are comments and are ignored as well.

A statement consists of a keyword and arguments, separated by any amount of whitespace. Arguments can be one of the following:

Identifiers
    Identifiers begin with a letter and consist of letters, digits, underscores and dashes. They serve as keywords and variable names.

Decimal numbers
    A sequence of decimal digits, optionally preceded by a minus or plus sign.

Unquoted strings
    An unquoted string is any contiguous sequence of any characters, except newlines, whitespace and the following special characters: \, ", !, =, <, >, (, ), {, }, [, ], $, %, &, |, ~, #.

Quoted strings
    A quoted string is a sequence of characters enclosed in double-quotes. Quoted strings are subject to backslash interpretation, backreference interpretation and variable expansion.

    During backslash interpretation, the escape sequences are recognized and replaced as per table below:
    	Sequence	Replaced with
    	\a	Audible bell character (ASCII 7)
    	\b	Backspace character (ASCII 8)
    	\f	Form-feed character (ASCII 12)
    	\n	Newline character (ASCII 10)
    	\r	Carriage return character (ASCII 13)
    	\t	Horizontal tabulation character (ASCII 9)
    	\v	Vertical tabulation character (ASCII 11)
    	\\	A single backslash
    	\"	A double-quote.
    	\%	Percent sign

    In addition, the sequence \newline is removed from the string. This allows to split long strings over several physical lines.

    During the backreference interpretation, references to parenthesized groups in regular expression are replaced with the actual content of the corresponding group in the most recently matched string. A reference is %{N} where N is a decimal number. If N is one digit, curly braces can be omitted: %N If the % character resulted from previous backslash interpretation, no backreference interpretation occurs.

    Strings used in the left-hand side of a comparison expression are subject to variable expansion. This is discussed later.

Backreferences
    The construct %{N} is replaced with the substring that matched the Nth parenthesized subgroup in a most recently performed regular expression match. If N is one digit, curly braces can be omitted.

Variable references
    Variable references consist of a $ sign, followed by the positional argument number or variable name, optionally enclosed in curly braces. Positional arguments greater than 9 must be enclosed in curly braces. The variable name must follow the rules for valid identifiers: it must begin with a letter and consist of letters, digits and underscores. Variable name in curly braces can be followed by -, =, ?, or +, optionally preceded by : as summarized in the table below:

    	Reference	Meaning
    	${VAR:-WORD}	Use Default Values
    	${VAR:=WORD}	Assign Default Values
    	${VAR:?WORD}	Display Error if Null or Unset
    	${VAR:+WORD}	Use Alternate Value

    where WORD stands for any valid token as described in this section. See the section VARIABLE EXPANSION, for a detailed discussion of these forms and their meaning.

Comparison and boolean operators
    These are:

    	&&	Boolean AND
    	||	Boolean OR
    	!	Boolean negation
    	==	Equality (string or numeric)
    	!=	Inequality (string or numeric)
    	<	Less than
    	<=	Less than or equal to
    	>	Greater than
    	>=	Greater than or equal to
    	~	Regexp matching
    	!~	Negated regexp matching
    	in	Membership in set of strings
    	group	Membership in UNIX group
    	=	Assignment
    	=~	Regular expression substitution

STATEMENTS
There are three global statements, two of which can contain multiple substatements.

  rush
Each configuration file must begin with the rush statement. It must be exactly as follows:

rush 2.0
    Declare version of the configuration file syntax.

If this statement is missing, the configuration file will be treated as legacy configuration file from previous versions of GNU rush. Currently two versions are supported. Version 2.0 is the current syntax version. Configuration file of the previous rush versions

global
    Introduces global settings. The settings changed within this section remain in effect until changed by the next global statement.

rule
    Defines a rule.

  global
The global statement

SEE ALSO
rush(8), rushlast(1), rushwho(1).

AUTHORS
Sergey Poznyakoff

BUG REPORTS
Report bugs to <bug-rush@gnu.org.ua>.

COPYRIGHT
Copyright © 2016-2019 Sergey Poznyakoff
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.