salawank

hostname IP grep

Sep 20th, 2011
111
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ more grepHref.sh
  2. grep "href" index.html | cut -d '/' -f3 | sort -u > ips.txt
  3.  
  4. $ more hostname.sh
  5. #!/bin/bash
  6. ##to check bundles of ip in ips.txt
  7. for hostname in $(cat ips.txt); do
  8. host $hostname | egrep "has address|is an alias"
  9. done
RAW Paste Data