Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Parameter Expansion
- X-seq: zsh-users 22818
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Parameter Expansion
- Date: Sun, 13 Aug 2017 16:51:18 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=pnlUJP3OhoeQ2wpPdkvyVKQLvZwLL3nCuEZePNpvCZM=; b=LuQcwCAy1h5CSu3ABW5VZRa8JGGsIpm8j5k/dZQjeLz5Zz53c6xSyuVYjb24rQPFrT sQfQB2HPhrdes9N9Ld/yH4um2G6ABY7dcUOmWHWJcQT6lmTTINbLzdhKbJD9bEUK2Ppy 4RmUrGAzoUfOxEalO7JkZSpfZySDX2c7y7OpLhawWElddxOjKIbpkSvSfM4N8EDddcAp jzMIVnz3ovQ7Ns0JWYH7FgRbsHKtHNH+B+SrlX7dEZPYpVUhWsYvoNGgdWdPjnfUPnYT 24S76uPP2/TbcQNBJe9Qu/u2NNs7S71jDJ67zdwMYpFrqZukDEZ3Cc5Y0WqGZdL2m9ZP IqhA==
- In-reply-to: <8df905ca-2d0e-953d-aca1-e46337784ae4@rxv.me>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <8df905ca-2d0e-953d-aca1-e46337784ae4@rxv.me>
On Sun, Aug 13, 2017 at 3:58 PM, Clint Priest <cpriest@xxxxxx> wrote:
> Having trouble getting nested parameter substitution working again, how can
> these two lines be correctly merged into a single line:
>
> FUNCS=( $SD/autoload/*);
> FUNCS=${(@)FUNCS:t};
You're mixing globbing with parameter substitution. Due to order of
operations (parameters before globs -- otherwise $SD/autoload/* would
not work) you can't do this via substitution.
Fortunately there are a lot of things you can do with globbing that
mimic parameter substitution, and :t happens to be one of them; you
can use it as a glob qualifier:
FUNCS=( $SD/autoload/*(:t) )
Messages sorted by:
Reverse Date,
Date,
Thread,
Author