Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
02-16-2004 09:05 AM
02-16-2004 09:05 AM
to an expect script or using autoexpect.
Just need to do a:
for i in
telnet $i
done
But pass the other commands also.
How would you get autoexpect to do this or
just in an expect file?
Would anyone have a similar example that I
could modify?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2004 09:13 AM
02-16-2004 09:13 AM
SolutionIn expect you can use argc and argv to capture the arguments.
Look at 'passmass' example under wherever_expect_is/bin directory if you already have expect installed.
...
for {set i 0} {$i<$argc} {incr i} {
set arg [lindex $argv $i]
switch -- $arg "-user" {....}
...
set host $arg
...
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2004 09:21 AM
02-16-2004 09:21 AM
Re: expect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2004 09:30 AM
02-16-2004 09:30 AM
Re: expect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2004 01:18 AM
02-17-2004 01:18 AM
Re: expect
.
.
That I have to use to telnet to the jetdirect cards and reset the IP and Gateway addresses. I have over 200 printers that have to be done so manually going to the printers would take about 60 hours or having to telnet to each printer manually and manually changing them would be just about as bad.
Since I can create an autoexpect script to do a telnet
Thanks to all for your input.
I will checkout the info you posted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2004 02:54 AM
02-19-2004 02:54 AM
Re: expect
it continues to loop for only the first line in the data file. Its not going to the next entry.
This is connecting to an HP jetdirect card so the expects are okay and it works on the first one from the data file but does not get the next enry. Something wrong with the "while" statement.
Can anyone help?
#!/opt/expect/bin/expect -f
set dfile "./testdata"
set file [open $dfile r]
gets $file line
while {![eof $file]} {
spawn telnet $line
expect "> "
send "/\r"
expect "> "
send "exit\r"
expect "Connection closed by foreign host.\r"
}
expect eof