A
Ajay
Finally getting hookedup to expect 
Here is the script i got to start with, it's working fine. I got it frm this NG.
Now i want to modify it to suit my taste.
1) I want to create a new xterm window from this script then telnet into the
remote server and then run the other commands.
2) In the script i have to expose password. How to amke it secure secure it ?
Any help will be appreciated.
Tx
Ajay
#!/opt/exp/bin/expect -f
set name "myname"
set password "XYZ"
set host "server1"
set prompt_regexp "\\$"
set timeout 60
spawn telnet $host
expect {
login: {
send "$name\n"
} timeout {
send_user "connection to $host timed out.\n"
exit
} eof {
send_user "connection to $host failed: $expect_out(buffer).\n"
exit
}
}
expect {
Password: {
send "$password\n"
} timeout {
send_user "connection to $host timed out.\n"
exit
} eof {
send_user "connection to $host failed: $expect_out(buffer).\n"
exit
}
}
Here is the script i got to start with, it's working fine. I got it frm this NG.
Now i want to modify it to suit my taste.
1) I want to create a new xterm window from this script then telnet into the
remote server and then run the other commands.
2) In the script i have to expose password. How to amke it secure secure it ?
Any help will be appreciated.
Tx
Ajay
#!/opt/exp/bin/expect -f
set name "myname"
set password "XYZ"
set host "server1"
set prompt_regexp "\\$"
set timeout 60
spawn telnet $host
expect {
login: {
send "$name\n"
} timeout {
send_user "connection to $host timed out.\n"
exit
} eof {
send_user "connection to $host failed: $expect_out(buffer).\n"
exit
}
}
expect {
Password: {
send "$password\n"
} timeout {
send_user "connection to $host timed out.\n"
exit
} eof {
send_user "connection to $host failed: $expect_out(buffer).\n"
exit
}
}