| << Previous | Contents Index | Next >> |
hello = "hello, world"
sets the symbol "hello" to contain the string "hello, world". Note that there must be whitespace either side of the '=' character.
Symbols can be substituted by use of the dollar sign ('$'). If unquoted, the string is parsed as if it is part of the input; whitespace within the expanded string will be parsed as a statement separator. The exception is that if the symbol is empty (or non-existent), the string will be treated as a null string, not a missing parameter.
In a string quoted with double quotes, the symbol is expanded inside the string; thus it will remain part of the parameter which the enclosing quotes represent, regardless of whitespace or quote characters contained in the expanded string.
Symbol substitution is not performed inside strings quoted with single quotes.
For example:
a = "hello world" # Statement Equivalent to keyword $a # keyword 'hello' 'world' (two parameters) keyword "$a" # keyword 'hello world' (one parameter) keyword '$a' # keyword '$a' (no substitution)
If a symbol being substituted has not been assigned, the environment is also searched; if there is still no match, the symbol is substituted with a null string.
The export keyword can be used to export an assigned keyword to the environment for use by a called subprocess, e.g.
hello = "hello, world" export hello
Several symbols are predefined:
| HOSTNAME | Full name of host. |
| HOST | Initial part of host name (truncated before first '.'). |
| PROGRAM | Name of program reading the configuration. |
| DATE | Date of run, in YYYY-MM-DD format. |
| TIME | Time of run, in HH:MM:SS format. |
Note that symbol definition can not be done inside a block.
The if statement is in the form if cond, with cond defined as parameter relop parameter [logop cond ...]. relop can be one of:
| = | Equal to |
| != | Not equal to |
| < | Less than |
| > | Greater than |
| <= | Less than or equal to |
| >= | Greater than or equal to |
Comparisons are done as either strings, or if both strings are wholly numeric, as numbers.
logop can be one of and or or.
| << Previous | Contents Index | Next >> |