Created
September 10, 2014 06:34
-
-
Save skihero/1f58208b0f6cb717d45e to your computer and use it in GitHub Desktop.
simple seq imp stolen
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 | |
#set -x | |
seq () { | |
if [ -z "$3" ]; then | |
incr=1 | |
j=$2 | |
else | |
incr=$2 | |
j=$3 | |
fi | |
i=$1 | |
while [[ i -le j ]]; do | |
echo -ne $i | |
echo -ne " " | |
let i+=$incr | |
done | |
START_RANGE=1 | |
END_RANGE=5200 | |
RANGE=$(seq ${START_RANGE} 1000 ${END_RANGE}) | |
REST_OF="a.b.cp" | |
echo "Pinging machine..." | |
for i in $RANGE | |
do | |
MACHINE="vmw${i}.${REST_OF}" | |
ping -n 2 ${MACHINE} | |
if [[ $? -eq 0 ]]; then | |
echo "REACHABLE: ${MACHINE} " | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment