__numset8
Deals with number-sets this program is part of afbackup
Usage
__numset <set-1-specifier>
{+ | - | in}
<set-2-specifier>
Overview
This Program deals with set of numbers and can either remove elements of one set that exists in another set, or merge two sets.
If the second argument is a +, then the two sets are merged. If the second argument is -, the elements in set2 are removed from set1.
If the second argument is the word "in", then it is tested, whether elements of set 1 are also contained in set 2.
The number of common elements will be the result in that case.
If the first argument is the character # (must be escaped in shell scripts, e.g. write '#'), the result is the number of elements in the set given as second argument. Number set specifiers should not contain whitespace and may consist of numbers, commas and dashes.
Examples
- Examples how to use __numset and the results:
prompt# __numset 1-3,5-9,14 + 10-12
|
The output will be: |
|
|
|
prompt# __numset 1-3,5-9,14 - 5-13
|
The output will be: |
|
|
|
prompt# __numset 3 - ""
-
The output will be:
-
3
- In this cases, it gives no output
-
prompt# __numset "" - 4,6,8
prompt# __numset 3 - 3-5
prompt# __numset # 4-9
Releases
3 releases since Debian 3.0 (Woody); the text changed 1 time.