run:./t3.sh
cat t3.sh
#!/bin/sh
DATE=`date +%Y-%m-%d-%H-%M`
./t2.sh | tee $DATE.tmp
exit 0
cat t2.sh
#!/bin/sh
for IP in 134 140 141 142 143 151 152 153 154 171 172 173 174 180 181 182 191 192 210 211 ; do
./t1.sh $IP
done
exit 0
cat t1.sh
#!/usr/bin/expect
set rip [lindex $argv 0]
spawn ssh -p 1098 -l uniadmin 10.199.75.$rip
expect "*password*"
send "uniadmin\r"
sleep 1
expect "*$*"
sleep 1
send "./connstat.sh\r"
send "pwd\r"
send "exit\r"
interact
阅读(2555) | 评论(0) | 转发(0) |