Get all ip address from subnet mask

I have this subnet file shown below. How can I calculate all ip addresses from that list

103.22.200.0/22 
141.101.64.0/18
10.0.0.0/22

I need to be able to read the subnet file and print all IPs in those subnet to an out put file

There will be thousands and thousands. Just comparing would be simpler and more effective than generating an exhaustive list.

Let say we have a subnet file that has 2 line

10.10.0.0/26
11.00.00.0/26

How would you list those ips in those subnets?

It'd make sense to compare instead of printing a comprehensive list. Subnets work the way they do because it's very easy to compare an IP to a subnet and mask with logical operations.

But if you insist I'll show you a way. It requires a 3.0+ BASH shell.

#!/bin/bash

printsubnet() {
        local OLDIFS="$IFS"
        local SUB=${1/\/*/}
        local MASK=$(( 1 << ( 32 - ${1/*\//} )))

        IFS="."
                set -- $SUB
                IPS=$((0x$(printf "%02x%02x%02x%02x\n" $1 $2 $3 $4)))
        IFS="$OLDIFS"

        for ((N=0; N<MASK; N++))
        {
                VAL=$((IPS|N))

                printf "%d.%d.%d.%d\n"                  \
                        $(( (VAL >> 24) & 255 ))        \
                        $(( (VAL >> 16) & 255 ))        \
                        $(( (VAL >> 8 ) & 255 ))        \
                        $(( (VAL)       & 255 ))
        }
}

printsubnet 172.16.0.0/16