salawank

hostname IP grep

Sep 20th, 2011
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.24 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment