Global and local environment variables
Beside standard support for environment variables, with set
and unset
commands, the shell also offers ability to set environment variables only for
the selected directories, in the same way how aliases set. At this moment,
available options for variables are:
- ID: The ID of the variable, used mostly for deleting or editing the selected variable
- Name: The name of the variable. It doesn't need to be unique, but if two variables in the same directory have the same name, then the last one value will be set as current value of the variable.
- Path: The main directory in which the variable set.
- Recursive: If set to 1, the variable is available for all subdirectories of the path. If set to 0, is available only in the selected directory.
- Type: The type of the variable's value. Determines what kind of values are
acceptable for the variable. Currently, three types of variables are available.
text
: anything,number
: any number,path
: a valid path. - Value: The value of the variable.
- Description: The variable description. Showed on the variables list.
For example, the definition of the variable can look that:
ID: 1
Name: MY_VAR
Path: /
Recursive: 1
Type: text
Value: someval
Description: Test variable
The definition of the local variable can look that:
ID: 2
Name: MY_VAR2
Path: /home/user
Recursive: 0
Type: number
Value: 12
Description: The second test variable
The variable will be available only in the user's home directory. It doesn't work in any of its subdirectory.
IMPORTANT: Commands set
and unset
doesn't work with the shell's
specific environment variables presented above. They work only with the
standard environment variables. To manage the shell's specific environment
variables use subcommands of the variable
command.