Script Cmd: SET
SET [-efh] [ {VAR} [VAL] | [=EXPRESSION]
Establish the content of a shell variable. This can be a simple equality (set VAR VAL) or it can be an expression (set VAR=$VAL+1).
As of Aug 2014, the SET command supports floating point operations by using -f option. See example and note4 below.
If no arguments are specified, set will simply dump the current environment to the console similar to the menu item Config->Environment->Display.
To remove a variable (VAR) from the environment, use "SET VAR" (with no value specified).
Options:
The expression evaluator handles the following operators in the following priority:
The evaluator supports logical functions for shifting and masking (|,&,>,<).
It also supports embedded functions. The current set of functions are:
The result is displayed in decimal unless somewhere within the expression the 'hex' function is used.
Examples:
Floating point examples (note the use of '-f'):
Note1: The expression must contain no whitespace.
Note2: Under the context of uCon, an exported shell variable means it will be saved to a configuration file if a save is done after being exported. This is convenient for cases where environment variables are configured on the first pass of a script, then on later invocations of uCon that same environment can be restored if the variables are exported.
Note3: A 'hidden' variable simply means that it will not be displayed by an environment dump issued through Config->Environment->Display. It will be displayed by the echo command, but this is up to the script.
Note4: As a result of the new -f option to support expressions with floating point, the 'IF' script command also supports a '-f' option to allow it to correctly process arguments.