/EVAL [expression]
Evaluates expression and executes result string as command.
Expression evaluation rules:
* all operators have the same precedence;
* supported operators:
. string concatenation
: string head
^ string tail
+ binary plus / string concatenation
- binary minus
* multiplication / string replication
/ division
% division remain
< binary / string less than
> binary / string greater than
= binary / string equality
* strings must be quoted with double quotes ("..."), within string backslash is used for character escaping (\\ and \" are only useful applications);
* parentheses can be used to change operators precedence, nested parentheses are supported as long as they are balanced;
* numbers can be specified as plain decimal numbers, minus in front of digit will be recognized as a part of number;
* mcabber variables can be specified by name, though only subset of possible names is suppoted:
- variable must start from latin alphabetic symbol;
- inside of variable name also are allowed digits, - and _;
* to enable parentheses in character strings current implementation ignores anything after extra closing paren - you may use this as a sort of comment...
Example:
/eval "echo 2 + 2 = " . (2+2)
/eval "set ping_interval = " . (ping_interval + 1) ) this example probably should use /let command.
/eval "echo " . (ssl_fingerprint : 5) . "..." . (ssl_fingerprint ^ 5) ) negative offsets are also supported