
apd(1) can be used from scripts, a few examples: 

$ number="`192.168.1.1-5 | asp -f plato`"
$ echo $?
0
$ echo $number
192.168.1.1   

$ number="`echo 2.2.2.2 | asp -f plato`"
$ echo $?
1
$ echo $number

$ # no match 


And a few comments from the author:

> COMMENTS:
> 
> Try to restrict the range of the addresses to those that the searched
> host could actually have: this saves bandwidth.
> 
> Metaip addresses are allowed only on the last part of the input
> addresses: if the possible ip addresses belongs to different networks,
> use as many metaip addresses as needed; this is because allowing
> metaip addresses as xxx.yyy.*.* or even *.*.*.* would not be a good
> idea...
> 
> Stenio Brunetta

