Hdel » History » Version 1
Per Amundsen, 02/11/2014 03:55 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | */hdel [-sw] <name> <item>* |
||
4 | |||
5 | Deletes an item from a hash table. |
||
6 | |||
7 | *Switches* |
||
8 | |||
9 | -s - Displays the result. |
||
10 | -w - Indicates item is a wildcard. |
||
11 | |||
12 | *Parameters* |
||
13 | |||
14 | <name> - The hashtable to delete from. |
||
15 | <item> - The hashtable item to delete. |
||
16 | |||
17 | *Example* |
||
18 | |||
19 | <pre> |
||
20 | alias example { |
||
21 | ;Create a hashtable and Add items. |
||
22 | /hadd -m example academic a |
||
23 | /hadd example academy a |
||
24 | /hadd example accelerate a |
||
25 | /hadd example accelerator a |
||
26 | /hadd example accept a |
||
27 | /hadd example access a |
||
28 | /hadd example accident a |
||
29 | /hadd example because b |
||
30 | |||
31 | ;Print Nmber of items. |
||
32 | /echo -a $hget(example, 0).item |
||
33 | |||
34 | ;Remove everything by one. |
||
35 | /hdel -w example a* |
||
36 | |||
37 | ;Print number of items. |
||
38 | /echo -a $hget(example, 0).item |
||
39 | |||
40 | ;Free table. |
||
41 | /hfree example |
||
42 | } |
||
43 | </pre> |