zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Parameter Expansion
Date: Sun, 13 Aug 2017 16:51:18 -0700	[thread overview]
Message-ID: <CAH+w=7aO6zWzXFk0ooHiw=4GS=LfQTsAKNa5unA8AOyajSB7sQ@mail.gmail.com> (raw)
In-Reply-To: <8df905ca-2d0e-953d-aca1-e46337784ae4@rxv.me>

On Sun, Aug 13, 2017 at 3:58 PM, Clint Priest <cpriest@rxv.me> 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) )


  reply	other threads:[~2017-08-13 23:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-13 22:58 Clint Priest
2017-08-13 23:51 ` Bart Schaefer [this message]
2017-08-14  0:07   ` Bart Schaefer
2017-08-14  1:16     ` Clint Priest
  -- strict thread matches above, loose matches on Subject: below --
1999-05-17  9:39 Parameter expansion Roland Jesse
1999-05-17  9:23 ` Peter Stephenson
1999-03-31 14:35 Mircea Damian
1999-03-31 14:54 ` Geoff Wing
1999-03-31 15:04   ` Mircea Damian
1999-03-31 15:51     ` Bart Schaefer
1999-04-01  6:20       ` Rob Hooft
1999-04-01  7:30         ` Geoff Wing
1999-04-01  7:33         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7aO6zWzXFk0ooHiw=4GS=LfQTsAKNa5unA8AOyajSB7sQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).