db_clear
Clear the whole database
Arguments
None
Returns
0Displays
nothingdb_copy
Duplicate a variable (copy content)
If the source variable is not set, target is created with an empty value
Arguments
$1 | Source variable name |
$2 | Target variable name |
Returns
0Displays
nothingdb_dump
Dump the database
Output format (each line) : <name><space><value><EOL>
The output is sorted alphabetically.
Arguments
None
Returns
0Displays
DB contentdb_expand
Replaces patterns in the form '{{%<variable name>%}}' by their value.
Allows nested substitutions (ex: {{%interface{{%hcfg:icount%}}/network%}}).
Patterns which do not correspond to an existing variable are replaced with an empty string.
Input: stdin, output: stdout.
Arguments
$1 |
Returns
0Displays
Outputdb_get
Get a variable value
If variable is not set, return an empty string (no error)
If global variable SF_DB_PATH contains '<stdin>', DB content is read from standard input.
Arguments
$1 | Variable name |
Returns
0Displays
Value or empty string if var not setdb_import
Import variables in dump format (one per line)
Lines are read from stdin
Arguments
None
Returns
0Displays
nothingdb_isset
Check if a variable is set
If global variable SF_DB_PATH contains '<stdin>', DB content is read from standard input.
Arguments
$1 | Variable name |
Returns
0 if variable is set, <> 0 if notDisplays
nothingdb_key
Build a key (regexp usable in grep) from a variable name
Arguments
$1 | Variable name |
Returns
0Displays
Key stringdb_list
List DB keys alphabetically, one per line
Arguments
None
Returns
0Displays
DB keysdb_normalize
Filter a name, leaving authorized chars only
Arguments
$1 | Variable name |
Returns
0Displays
Normalized namedb_rename
Rename a variable (keep content)
If the source variable is not set, target is created with an empty value
Arguments
$1 | Source variable name |
$2 | Target variable name |
Returns
0Displays
nothingdb_set
Set a variable
Arguments
$1 | Variable name |
$2 | Value |
Returns
0Displays
nothingdb_set_timestamp
Set a variable with the value returned by tm_now
Arguments
$1 | Variable name |
Returns
0Displays
nothingdb_unset
Unset a variable
No error if variable was not present in DB
Arguments
$* | Variable names |