Re: [Expect] [Activetcl] How to pass parameters to a file "test.tcl" fromcommand line
by Tylik Dmitry-R49752 other posts by this author
Aug 17 2007 8:47AM messages near this date
view in the new Beta List Site
[Expect] How to pass parameters to a file "test.tcl" from command line
|
Re: [Expect] Error in Expect "spawn id exp7 not open"
S.Suresh,
this is actually simple. Tcl internally maintains the argv variable
which is a list containing all the command line parameters to the
script. So if you need the 1st parameter you get it with [lindex $argv
0], the 2nd with [lindex $argv 1] and so on
--
Best regards,
Dmitry
________________________________
From: activetcl-bounces@[...].com
[mailto:activetcl-bounces@[...].com] On Behalf Of Suresh
Sundararaman
Sent: Thursday, August 16, 2007 5:13 PM
To: activetcl@listserv.ActiveState.com; expect@[...].com
Subject: [Activetcl] How to pass parameters to a file "test.tcl"
fromcommand line
Hi All,
I have a script called "test.tcl". Here i want to pass one parameter
which is a simple text file. Like:
%tclsh test.tcl somefile.txt
The "somefile.txt" has got 3 values, one is IP address, another one is
mode1 and last one is mode2.
How can i write the piece of code to do this in "test.tcl" ?
Can anyone guide me across thru it ?
Rgds,
s.suresh
________________________________
Want to look great? Get expert opinion on beauty and skin care. Ask the
expert! <http://content.msn.co.in/Lifestyle/AskExpert/Default01.htm>
Thread:
Suresh Sundararaman
Tylik Dmitry-R49752
|