![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| expect help | Smoker | Shell Programming and Scripting | 1 | 10-08-2008 02:26 PM |
| Any good tutorials or sites for expect scripting? | rkruck | Shell Programming and Scripting | 4 | 08-27-2008 10:59 AM |
| Calling expect scripts from other expect scripts | seva | Shell Programming and Scripting | 0 | 04-03-2008 02:45 PM |
| Help required on expect scripting | ayyappakumar | UNIX for Dummies Questions & Answers | 1 | 05-29-2007 06:04 AM |
| Expect and auto expect command | arun_v | Shell Programming and Scripting | 0 | 03-29-2006 08:31 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
expect scripting need help
Hi experts,
I am trying to develop a script using Expect. I am stuck somewhere. I need ur help guys. I have sun solaris where i need to input the following commands- bash-2.05$ telnet 11.13.58.39 2310 Trying 0.0.0.0... Connected to .. Escape character is '^]'. CONNECTING TO... PROCESS 2310 CONNECTED... Enter command: LOGIN:user1:passwd1; RESP:0; Enter command: GET:SUBSCRIBERINFORMATION:SubscriberNumber,012365875; RESP:0:Profile,01:MSI,987012365875:RIM,987012365875 Enter command: LOGOUT; RESP:0; Enter command: Connection to . closed by foreign host. $ Now i want to made a ineterface for someusers in my solaris. The user will enjoy their own interface. To do this I changed the .profile of a username "john". And when john login he will see- root@ircemaprod # su - john Sun Microsystems Inc. SunOS 5.9 Generic May 2002 ----------Welcome to Command Interface---------- Enter Command or type EXIT to exit GET:SUBSCRIBERINFORMATION:SubscriberNumber,012365875; GET:SUBSCRIBERINFORMATION:SubscriberNumber,012365875; RESP:0:Profile,01:MSI,987012365875:RIM,987012365875; Enter command: Enter Command or type EXIT to exit EXIT Now u see "command" comes twice. and "Enter command" prompt comes again. I don't want see those redcolor in my interface. How to do dear experts?? Please let me know if you need more info from me ? Attached is .profile for user john and and expect script-- #!/usr/local/bin/expect -f set timeout 180 set server [lindex $argv 0] set ip [lindex $argv 1] set user [lindex $argv 2] set passwd [lindex $argv 3] set cmd [lindex $argv 4] log_user 0 spawn telnet $server $ip expect "command: " send "LOGIN:$user:$passwd;\r" expect "command: " log_user 1 send "$cmd\r" expect "command: " send "LOGOUT;\r" exit ----------- Last edited by thepurple; 12-01-2008 at 07:24 AM.. |
|
||||
|
Here is it-
I have unix server where i have a application for some special commands. Below way to entering in that application- bash-2.05$ telnet 11.13.58.39 2310 Trying 0.0.0.0... Connected to .. Escape character is '^]'. CONNECTING TO... PROCESS 2310 CONNECTED... Enter command: LOGIN:user1 asswd1;RESP:0; Enter command: GET:SUBSCRIBERINFORMATION:SubscriberNumber,012365875; RESP:0:Profile,01:MSI,987012365875:RIM,987012365875 Enter command: LOGOUT; RESP:0; Enter command: Connection to . closed by foreign host. $ Now i want to make a ineterface for a user "john" in same machine where . User "john" will use the below ineterface. In fact, below ineterface will directly ineterct with above green colored ineterface. Whatever the command "john" will put the below ineterface- command will go to above mentioned application and show the response- root@ircemaprod # su - john Sun Microsystems Inc. SunOS 5.9 Generic May 2002 ----------Welcome to Command Interface---------- Enter Command or type EXIT to exit GET:SUBSCRIBERINFORMATION:SubscriberNumber,012365875; GET:SUBSCRIBERINFORMATION:SubscriberNumber,012365875; RESP:0:Profile,01:MSI,987012365875:RIM,987012365875; Enter command: Enter Command or type EXIT to exit EXIT Now u see "command" comes twice. and "Enter command" prompt comes again. I don't want see those redcolor in my interface. |
![]() |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix commands, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|