iprange
iprange copied to clipboard
using --reduce-factor disables --except
This is from iprange 1.0.5_master.
First, set up two test files:
$ cat <<EOF >in
1.2.3.4
1.2.3.5
1.2.3.6
9.9.9.6
9.9.9.7
9.9.9.8
9.9.9.9
EOF
$ cat <<EOF >except
1.2.3.4
1.2.3.5
1.2.3.6
EOF
Without using --reduce-factor I get the expected output:
$ iprange in --except except >out
$ iprange in --diff out
1.2.3.4/31
1.2.3.6
Using any value of --reduce-factor causes the --except to be ignored:
$ iprange in --except except --reduce-factor 0 >out
$ iprange in --diff out
$ iprange in --except except --reduce-factor 10 >out
$ iprange in --diff out
$ iprange in --except except --reduce-factor 90 >out
$ iprange in --diff out
$ diff in out
$
If you do the operations sequentially, you get the correct output:
$ iprange in --except except >tmp
$ iprange tmp --reduce-factor 90 >out
$ iprange in --diff out
1.2.3.4/31
1.2.3.6
If you reverse the order of the two options, you get the correct output:
$ iprange in --reduce-factor 90 --except except >out
$ iprange in --diff out
1.2.3.4/31
1.2.3.6