- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Expect script help...
Operating System - HP-UX
1752377
Members
6547
Online
108788
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2010 04:53 AM
тАО08-06-2010 04:53 AM
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
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
- Tags:
- expect
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2010 04:58 AM
тАО08-06-2010 04:58 AM
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2010 06:22 AM
тАО08-06-2010 06:22 AM
Re: Expect script help...
This helped...
http://forums.whirlpool.net.au/forum-replies-archive.cfm/793887.html
thanks,
Karthik
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
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP