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

4.4.3.2 The insert statement

The insert statement inserts new positional argument at a given position. Its syntax is similar to set:

rule: insert [n] = value
rule: insert [n] = value ~ s-expr

Shift arguments starting from n one position to the right (so that n becomes n+1 etc.) and insert value at argv[n].

In the second form, the value to be inserted is computed by applying sed-expression s-expr to value.

Both value and s-expr are subject to variable expansion and backreference interpretation.

Example using this statement to insert the --root=/tmp argument at position 1:

insert [1] = "--root=/tmp"

Note that when inserting multiple arguments (e.g. an option with a value), you have two possibilities. First, you can insert each argument at its corresponding position. For example, to insert two arguments ‘--root’ and ‘/tmp’ starting at position 1, one can use:

insert [1] = "--root"
insert [2] = "/tmp"

Otherwise, you can revert the arguments and insert them at the same position, as shown in the example below:

insert [1] = "/tmp"
insert [1] = "--root"

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