Sep 30, 2003 #2 Ygor Programmer Feb 21, 2003 623 GB awk '{ if (match($0,"^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}") print substr($0,RSTART,RLENGTH) }' /etc/hosts Upvote 0 Downvote
awk '{ if (match($0,"^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}") print substr($0,RSTART,RLENGTH) }' /etc/hosts
Sep 30, 2003 #3 johngiggs Technical User Oct 30, 2002 492 US Or you could use something simple like: awk '/^[0-9]/{print $1}' /etc/hosts John Upvote 0 Downvote