Skip to content

Instantly share code, notes, and snippets.

@aaronmelton
Created February 16, 2015 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronmelton/5edcb8006df3b7dae6ea to your computer and use it in GitHub Desktop.
Save aaronmelton/5edcb8006df3b7dae6ea to your computer and use it in GitHub Desktop.
This script uses native whois command to return the WHOIS information of the IP Addresses provided.
#!/usr/bin/sh
#
# downloadWHOIS.sh
#
# This script uses native whois command to return the WHOIS information
# of the IP Addresses provided.
#
# USAGE:
# $ ./downloadWHOIS.sh 1.2.3.4
# $ ./downloadWHOIS.sh 1.2.3.4 1.2.3.5 1.2.3.6 etc.
#
# Set path to save files:
path=/Downloads/
# Set filename prefix and/or suffix:
prefix=
suffix=\_whois.txt
for args in "$@"
do
whois $args > $path$prefix$args$suffix
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment