#!/bin/sh clear printf "IP Address?: " read u_ip ipchk=`ifconfig 2>&1 | grep inet | grep -v inet6 | awk '{print $2}' | grep $u_ip` while [ "$ipchk" == "" ] do echo "Invalid Ip" echo " " printf "IP Address?: " read ip ipchk=`ifconfig 2>&1 | grep inet | grep -v inet6 | awk '{print $2}' | grep $u_ip` done if [ "$ipchk" == "$u_ip" ] ; then ip="$ipchk" echo "IP: $ip" fi ### results ### # get-test IP Address?: 145 [: 208.74.173.145: unexpected operator [: 208.74.173.145: unexpected operator