1748128 Members
3542 Online
108758 Solutions
New Discussion юеВ

Expect script help...

 
Karthik S S
Honored Contributor

Expect script help...

Hi,

I have the following expect script:
###########################################
#!/usr/bin/expect -f
set password [lrange $argv 0 0]
set ipaddr [lrange $argv 1 1]
set arg1 [lrange $argv 3 3]
set timeout -1
set prompt "$"
spawn ssh user@$ipaddr
match_max 100000
expect "*?assword:*"
send -- "$password\r"
expect -re $prompt
send -- "somecommand\r"
expect -re $prompt
###########################################

Which when executed gives the output something like this:

./myexpectscript ipaddr password
###########################################
Some text..
Some more text...
Properties:
var1 = my
var2 = dont_need_this
var3 = name
var4 = is
var5 = karthik
###########################################

Instead I want the selected portion of the o/p to be formatted and displayed like this:

| my | name | is | karthik |

Appreciate any help on this

Thank you,
Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
2 REPLIES 2
Karthik S S
Honored Contributor

Re: Expect script help...

One small clarification. I want the formatting of output to happen with in the same script and only the final formatted output displayed on screen.

Thanks,
Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Karthik S S
Honored Contributor

Re: Expect script help...

This helped...
http://forums.whirlpool.net.au/forum-replies-archive.cfm/793887.html

thanks,
Karthik
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn