ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> expect
expect
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved