1. for循环:
for shname in `ls *.sh`
do
name=`echo "$shname" | awk -F. '{print $1}'`
echo $name
done
2. 自动登录:
#!/usr/bin/expect
spawn ssh rd@10.231.145.240
expect "*password:*"
send "a78P1meZi1\r"
interact
需要./login.sh类似这样运行,因为因为expect用的不是bash所以会报错。