hi all,
i have this script that accepts passwords automatically and its working in one host only. my problem is how will i use it if i need it to run in more than one host/server let say by using "for loop statement"
working :
spawn bundle linux -r hostname checkpath /opt/home/support/.k5login
expect "password:"
send "xxxxyyyy0f!\r"
interact
not working:
!/usr/bin/expect -f
for i in `awk '{print $1}' server_list`
do
echo $i
spawn bundle linux -r $i checkpath /opt/home/support/.k5login
expect "password:"
send "xxxyyyy!\r"
interact
done
here is an error:
----
[root@kickstart SE]# ./ray1.sh
can't read "1": no such variable
while executing
"for i in `awk '{print$1}' server_list`"
(file "./ray1.sh" line 2)
-----
appreciate much your reply on this.