[prev in list] [next in list] [prev in thread] [next in thread] 

List:       visual-tcl
Subject:    RE: [vtcl-user] A few newbie Tcl/Tk, Visual Tcl observations
From:       "Birt, Jeffrey" <birtj () umr ! edu>
Date:       2004-04-29 13:46:29
Message-ID: 4ADED5603BF8714FA71CF3F3760FA330A96AF0 () umr-mail10 ! umr ! edu
[Download RAW message or body]

Thanks, Larry that works great.

Jeff Birt
Electronics Engineer
Integrated Systems Facility
University of Missouri - Rolla
573.341.6058 


-----Original Message-----
From: vtcl-user-admin@lists.sourceforge.net
[mailto:vtcl-user-admin@lists.sourceforge.net] On Behalf Of Larry W.
Virden
Sent: Wednesday, April 28, 2004 11:49 AM
To: vtcl-user@lists.sourceforge.net
Subject: Re: [vtcl-user] A few newbie Tcl/Tk, Visual Tcl observations

>  It seems to get confused if more than three switches are used after
> the argument, also each switch had to be held in a seperate variable:
> exec rdesktop $sw1 $sw2 $sw3 $ip.  

What you were looking for was the Tcl "eval" command.

set args [list -l -t -r]
eval exec ls $args /tmp

When you call exec, it executes the command represented by its first
argument, passing it as separate arguments the value of each variable.

So, in the above case, if I had incorrectly tried
exec ls $args /tmp

then my ls command would have received 2 arguments.  The first would
have been "-l -t -r" and the second "/tmp" .

Now, ls has no idea what an argument of "-l -t -r" is - it knows things
like "-l" and "-t" and "-r" ... but not those spaces in there.



-- 
Tcl - The glue of a new generation.  <URL: http://wiki.tcl.tk/ >
Larry W. Virden <mailto:lvirden@cas.org> <URL:
http://www.purl.org/NET/lvirden/>
Even if explicitly stated to the contrary, nothing in this posting
should 
be construed as representing my employer's opinions.
-><-


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.

Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
vtcl-user mailing list
vtcl-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vtcl-user


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id66&opĚk
_______________________________________________
vtcl-user mailing list
vtcl-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vtcl-user

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic