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 >> activetcl
activetcl
Re: [Activetcl] cat problems
by Andreas Kupries other posts by this author
Jun 10 2008 8:28AM messages near this date
view in the new Beta List Site
Re: [Activetcl] cat problems | [Activetcl] question about teapot metadata
Just as a note, this is a feature of Tcl 8.5.
Tcl 8.4 doesn't have it.
The TIP specifying this feature is http://tip.tcl.tk/157
Note that the TIP calls it {expand}, that was later changed to {*}.

--
        Andreas Kupries <andreask@[...].com> 
        Developer @ http://www.ActiveState.com
        Tel: +1 778-786-1122

  -----Original Message-----
  From: activetcl-bounces@[...].com
[mailto:activetcl-bounces@[...].com]On Behalf Of Bartis,
Robert M (Bob)
  Sent: Tuesday, June 10, 2008 8:19 AM
  To: Virden, Larry W.; activetcl@[...].com
  Subject: Re: [Activetcl] cat problems


  Larry

  Pardon my ignorance, but can you expand a little on how the addition of
{*} results in the expansion you mentioned. This is completely new to me and
I'd be interested in a little deeper understanding of the mechanics.

  Thanks in advance....as always for your insights
  Robert M. Bartis
  Stinger Quality Assurance
  TEL: (908) 582-6566
  EMAIL: bartis@[...].com





----------------------------------------------------------------------------
    From: activetcl-bounces@[...].com
[mailto:activetcl-bounces@[...].com] On Behalf Of Virden,
Larry W.
    Sent: Tuesday, June 10, 2008 11:15 AM
    To: activetcl@[...].com
    Subject: Re: [Activetcl] cat problems



    This is a Frequested Encountered Problem in Tcl. What you coded was a
string, then had Tcl pass that string along to cat to open.
    The cat command sees a single argument, with spaces in it. There's no
file by that one name. So it correctly reports that problem to you.

    The solution to this is to "expand" the string into the arguments. To do
this, you would code

    exec cat {*}$catgroup >  $name




    --

    <URL: http://wiki.tcl.tk/ > 

    Even if explicitly stated to the contrary, nothing in this posting

    should be construed as representing my employer's opinions.

    <URL: mailto:lvirden@[...].com >  <URL: http://www.purl.org/NET/lvirden/
> 







----------------------------------------------------------------------------
    From: activetcl-bounces@[...].com
[mailto:activetcl-bounces@[...].com] On Behalf Of Gene Osteen
    Sent: Tuesday, June 10, 2008 11:06 AM
    To: activetcl@[...].com
    Subject: [Activetcl] cat problems


    All,

                I am trying to run a script on windows with the GNU core
utils installed. I want to use the cat command. I have three files:

    one.gz.aa

    one.gz.ab

    one.gz.ac



    In wish if I enter:

    exec cat one.gz.aa one.gz.ab one.gz.ac >  one.gz

    everything works fine.



    However if I enter:

    set catgroup "one.gz.aa one.gz.ab one.gz.ac"

    set name one.gz

    exec cat $catgroup >  $name



    I get the following:

    C:\Program Files\GnuWin32\bin\cat.exe: one.gz.aa one.gz.ab one.gz.ac: No
such file or directory





    Can anyone help





    Gene O
Thread:
Gene Osteen
Larry W. Virden
Robert M Bartis
Andreas Kupries

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