#!/bin/bash3 ip="$1" isip=1 if [[ $ip =~ '[0-9]{1,3}(\.[0-9]{1,3}){3}' ]] then IFS=. for n in $ip do ((n < 256)) || exit 1 done exit 0 fi exit 1