Created
December 24, 2013 08:35
-
-
Save spidersea/8110409 to your computer and use it in GitHub Desktop.
Linux shell脚本 while命令解决 ssh登陆单行问题
This file contains 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 | |
cat list |while read line | |
do | |
echo ===============$line | |
TARGE_IP=`echo $line|awk '{print $3}'` | |
TARGE_PORT=`echo $line|awk '{print $4}'` | |
ssh -p $TARGE_PORT $TARGE_IP "ps axu|grep webserver" < /dev/null | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment