Expect is a program that "talks" to other interactive programs according to a script. Following the script, Expect knows what can be expected from a program and what the correct response should be. An interpreted language provides branching and high-level control structures to direct the dialogue. In addition, the user can take control and interact directly when desired, afterward returning control to the script.
Example:
#!/usr/bin/expect -f
#expect to ssh
set user <user_name>
set userpass <user_password>
set ipadd <ip_address>
spawn ssh $user@$ipadd;
expect "Password: "
send "$userpass\r"
expect "$user@hostname # "
send "<command> \r"
send "exit \r"
expect eof
#!/usr/bin/expect -f
#expect to telnet
set user <user_name>
set userpass <user_password>
spawn telnet <ip_address>
expect "Username:"
send "$user\r"
expect "password:"
send "$userpass\r"
expect "Hostname#"
send "<command> \r"
send "exit\r"
expect eof
Subscribe to:
Post Comments (Atom)
-
The cause code value in the GTPv2 message can indicate what happened between MME, SGW, and PGW so as to simplify the troubleshooting process...
-
The main function of the mobility management sublayer is to support the mobility of a user equipment, such as informing the network of its...
-
Dalam GTP request, cause value menunjukkan alasan request tersebut. Cause value tersebut akan dimasukkan dalam GTP request message. Dalam...
-
The purpose of the Cause IE is to indicate the reason for a particular event for the S1AP protocol. The meaning of the different cau...
-
The main function of the ESM sublayer is to support the EPS bearer context handling in the UE and in the MME. The ESM comprises procedure...
-
Definition: S1AP consists of Elementary Procedures (EPs). An Elementary Procedure is a unit of interaction between eNBs and the EPC. These...
No comments:
Post a Comment