The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 09-04-2001
Perderabo's Avatar
Perderabo Perderabo is offline
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,430
In ksh you can use patterns...
Code:
if [[ $1 = +([0-9]).+([0-9]).+([0-9]).+([0-9]) ]] ; then
   echo $1 is an ip address
else
   echo $1 is not an ip address
fi