Tcl question ...
Clemens Lang
cal at macports.org
Thu Sep 19 04:43:56 PDT 2013
On Thu, Sep 19, 2013 at 06:24:17AM -0500, Ryan Schmidt wrote:
> To combine them you probably need eval:
>
> eval delete [glob */*.pyc]
The problem here is that delete (or file delete) expect the files to be
deleted as (multiple) parameters, but [glob */*.pyc] returns a list of
files (which is one parameter).
To solve this, you could expand the list returned by glob to a list of
parameters for file delete using
delete {*}[glob */*.pyc].
However, this is only supported on Tcl >= 8.5 and MacPorts base still
works on platforms that only have Tcl 8.4. The alternative is using
eval, as Ryan explained, since it will (in this case) achieve the same
thing.
--
Clemens Lang
More information about the macports-dev
mailing list