Monday, July 30, 2012

strip ips from zonefile

so i want to strip ips from a zone file. easy.
dump it. scp it. whatever.


#!/bin/bash
echo "enter zone file"
read zonefile    
fileName=`pwd`"/$zonefile"

if [ -f "$zonefile" ] ; then

sed -n 's/\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/\nip&\n/gp' $zonefile | grep ip | sed 's/ip//'| sort | uniq > stripped

fi
Post a Comment