Unset » History » Version 6
Per Amundsen, 02/16/2023 05:06 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | 3 | Per Amundsen | */unset [-slg] <%var> [%var..]* |
4 | 1 | Per Amundsen | |
5 | Unset local or global variables, local variables take precedence over a global variable with the same name. |
||
6 | |||
7 | 2 | Per Amundsen | [[Scripting_Wildcards|Wildcards]] is allowed. |
8 | 1 | Per Amundsen | |
9 | 5 | Per Amundsen | _See also [[/var]], [[/set]], [[/inc]], [[/dec]], [[/vars]], [[$var]], [[Variables_Dialog|Edit Variables]]._ |
10 | 4 | Per Amundsen | |
11 | 1 | Per Amundsen | *Switches* |
12 | |||
13 | 6 | Per Amundsen | table(ktable). |
14 | |*Switch*|*Description*| |
||
15 | | -s | Prints unset information. | |
||
16 | | -l | Unset local variable(s). | |
||
17 | | -g | Unset global variable(s). | |
||
18 | 1 | Per Amundsen | |
19 | *Parameters* |
||
20 | |||
21 | 6 | Per Amundsen | table(ktable). |
22 | |*Parameter*|*Description*| |
||
23 | | <%var> | Variable to unset. | |
||
24 | | [%var..] | Additional variables to unset. | |
||
25 | 1 | Per Amundsen | |
26 | *Example* |
||
27 | |||
28 | <pre> |
||
29 | alias example { |
||
30 | ;Create and fill a variable with data. |
||
31 | /set %var1 Variable test. |
||
32 | |||
33 | ;Print the variable value. |
||
34 | /echo -a %var1 |
||
35 | |||
36 | ;Unset the variable. |
||
37 | unset %var1 |
||
38 | |||
39 | ;Print the variable value after unset. |
||
40 | echo -a %var1 |
||
41 | } |
||
42 | </pre> |