This script calculates several values with the input of IP-address and subnetmask or IP-address and CIDR. see example below.
#################################################
# #
# IP Calculator #
# #
# by #
# #
# Owen Trafalgar #
# #
#################################################
# #
# syntax: #
# #
# ./ipcalc.sh [ip-address]/[cidr] #
# ./ipcalc.sh 192.168.0.1/24 #
# #
# or #
# #
# ./ipcalc.sh [ip-address] [netmask] #
# ./ipcalc.sh 192.168.0.1 255.255.255.0 #
# #
#################################################
./ipcalc.sh 192.168.0.123/24
#################################################
# #
# IP Calculator #
# #
# by #
# #
# Owen Trafalgar #
# #
#################################################
# #
# IP-Address: 192.168.0.1 #
# IP-Class: C #
# Use Case: Private #
# Netmask: 255.255.255.0 #
# CIDR Suffix: 24 #
# Wildcard: 0.0.0.255 #
# Network Address: 192.168.0.0 #
# Broadcast: 192.168.0.255 #
# Number of IP-Addresses: 256 #
# Number of possible Hosts: 254 #
# Host IP Start: 192.168.0.1 #
# Host IP End: 192.168.0.254 #
# #
#################################################