/dev/null,将ssh
的输入重定向输入
while
read
ips
do
echo
$ips
upt=`ssh
root@${ip1}
uptime
<
/dev/null`
echo
$upt
done
<
ip.txt
2、用for
for
ips
in
`cat
ip.txt`
do
echo
${ips}
upt=`ssh
root@${ips}
uptime`
echo
$upt
done
#!/bin/bashecho "Enter password:"
read TRY
COUNTER=1
while [ "$COUNTER" -lt 5 -a "$TRY" != "secret" ]do
echo "Here we go again"
COUNTER=$(($COUNTER+1))
read TRY
done
[ "$TRY" != "secret" ] &&echo "error!"
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)