Created
December 5, 2017 04:42
-
-
Save fmtarif/23030a01120b2984a8560dfe4ae9b8c4 to your computer and use it in GitHub Desktop.
#cli #bash ping sites and echo IP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
for s in $(cat sites.txt); do | |
ip=$(ping -c 1 $s | gawk -F'[()]' '/PING/{print $2}') | |
echo "$s: $ip" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment