#!/bin/sh clear printf "IP Address?: " read u_ip ipchk=`ifconfig | grep "$u_ip"` while [ "x$ipchk" == "x" ] do echo "Invalid Ip" printf "IP Address?: " read ip done if [ "x$ipchk" != "x" ] ; then ip="$u_ip" echo "IP: $ip" fi ### results ### # get-test IP Address?: 45 [: x inet 208.74.173.145 netmask 0xffffff80 broadcast 208.74.173.255: unexpected operator IP: 45