Skip to content

Instantly share code, notes, and snippets.

@moinsam
Created November 29, 2018 04:38
Show Gist options
  • Save moinsam/3a6a079aa16b664809e6bd54df25e75e to your computer and use it in GitHub Desktop.
Save moinsam/3a6a079aa16b664809e6bd54df25e75e to your computer and use it in GitHub Desktop.
declare -a ipAddress
x=0
for((i = 10; i <= 20; i++)) {
ipAddress[$x]="hostname-${i}.end.local"
((x=x+1))
}
for ip in "${ipAddress[@]}"; do
printf "$ip %s\\n" $(dig +short "$ip")
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment