Need Help in Loop Foreach



Hi, I'm new to Expect/TCL can someone help me out with this simple script.

I'd like to insert a loop, in such a way that it reads all the "System ID"
from a file called "SysIDList"

# cat SysIDList
8
9
10

#!/usr/local/bin/expect
# Query all the systems status by inputting the SystemIDs on Expect Script

set env(HOME);
log_file $env(HOME)/getsys-out3;
spawn sys_monitor;
expect
"**********************************************************************";
expect "* SYSMonitor
*";
expect
"**********************************************************************";
expect " SYSMonitor-> ";
send "QUERY\r";
expect " ======================================";
expect " System ID :";
send "8\r"; # This is where the loop would be needed.
expect " SYSMonitor-> ";
send "exit\r";
log_file;



.



Relevant Pages

  • Re: Report in FM 6 or 7
    ... achieve this report format will have to be done via scripting. ... but they will simplify the script and Sort Order. ... End Loop ... The normal 'Dancer' field is used so that if there are more than one ...
    (comp.databases.filemaker)
  • Re: recreate database script not work
    ... I got a script which is supposed to regenerate database systax. ... REM gen_dbse_9.sql ... end loop; ...
    (comp.databases.oracle.server)
  • Re: Loop Problem (At Least I think)
    ... If there are no images matching the product ... "" Then" statement (the one below the loop, outside of it), is this just ... >> script to finish. ... > 2) Read the database table and acess the dictionary object for the ...
    (microsoft.public.scripting.vbscript)
  • Re: How to set up a global variable in a sub-routine?
    ... the 'global variables' are more like constants ... ... single script, I need a way to tell it only once where the file is and ... So, if you construct a loop with a loop variable, you ... >programmers avoid global variables completely. ...
    (perl.beginners)
  • RE: (Urgent) Create many txt files from tables with DTS Package
    ... when i run this script the error show: ... > How to loop through a global variable Rowset ... >> D.90.70.0002 Husain Djojonegoro BOARD OF COMMISSIONER ... >> D.50.04.0071 Putu Supertama Checker BI ...
    (microsoft.public.sqlserver.dts)