redis_ Script Filter 1

# / bin / bash

RM redis.txt # delete text information once obtained
rm redis1.txt # delete text information once obtained
for TEST__RED in $ (cat RED_IP) #for script cycles
do
(SLEEP 10) | `SSH $ TEST__RED netstat -anpt | grep redis | awk '{ print $ 5}' | awk -F: '{print $ 1}' >> 'redis.txt'` # remote command execution footsteps
echo "########### ####### ">> RED_TEST_IP
DONE
###################################### #####
the Sort -u redis.txt >> redis1.txt generated IP address filtering

2.

# / bin / the bash
RM redis_jetty_app.txt
RM redis_jetty.txt
CAT hg_jetty_app.txt | awk '{}. 1 Print $' | IP Read the while; # see and read the text information IP variables
do
for Line in $ (CAT redis1.txt | awk '{print $ 1} '); the IP address acquired reids line into variable 
do
IF [[== $ $ line IP]]; # determination is made if the then two values are equal to the values of two variables acquired redis_jetty_app.txt information corresponding to the document
`CAT hg_jetty_app.txt | grep -w $ Line >> redis_jetty_app.txt`
the else
echo $ # IP >> No_match_redis or read other file
fi
DONE
DONE
##### ####################################
Sort -u redis_jetty_app.txt >> redis_jetty.txt filtered repeated IP address information

Guess you like

Origin www.cnblogs.com/quemengqio/p/11949521.html