Issue in running commands in expect script from shell script
Hi All,
I have the problem to run the commands in expect script from shell script.
Mentioned below is the expect script.
#!/usr/local/bin/expect -f
#set -x
set NODENAME [lindex $argv 0]
set NAME [lindex $argv 1]
set timeout 50
spawn eaw "$NODENAME\r"
expect "<"
sleep 01
send "xxx:xxx=xxx,xxx=$NAME;\r"
## here it automatically gets the name.
expect "<"
sleep 00
send "exit;\r"
Here i want to run some commands.
I am able to login using node name(which is basically the BSC Node).Also
my first command is working fine.
Input of nodename and cellname i am getting from shell script and is automatically taking that.
But for me the next challenge is to run the next commands ..
In expect script we have
send "xxx:xxx=xxx,xxx=$NAME;\r"
## here it automatically gets the name
and this command will display the output like
Mentioned output is
G=1
so my next command should take these values of G1 which is 1
First it should fetch that selected value "1" and then run the
next command and put that value 1 in the gap .
<xxx:xx=xxx- ; ## By defining "1" in the space command should run
then it further run the next command and finally exit.
How can i do that. How should i define the variables for the next commands also?
..I am totally stuck..
Somebody help me in this ASAP....
|