#!/bin/bash for i in ${cat $1};do ipcalc -cs $i if [ $? -eq 0 ];then echo $i else echo "ip address inlegal" fi