From: Jilles Tjoelker <jilles@stack.nl>
To: Rusty Bird <rustybird@openmailbox.org>
Cc: dash@vger.kernel.org
Subject: Re: Ignored alias inside for loop
Date: Sun, 26 Jul 2015 20:41:59 +0200 [thread overview]
Message-ID: <20150726184159.GB4346@stack.nl> (raw)
In-Reply-To: <55B50628.5090901@openmailbox.org>
On Sun, Jul 26, 2015 at 04:09:12PM +0000, Rusty Bird wrote:
> > Aliases are expanded during parsing, not during execution (like
> > functions are). The for loop is parsed completely before it is
> > executed.
> Ah, what confused me was that I wrongly remembered it working inside
> an if (instead of for) block. But looking again now, only the alias
> *definition* was inside.
> > Using a function instead of an alias, or using eval will do what
> > you want.
> Do you mean replacing the line with: eval "alias foobarbaz='echo ok'"
> That doesn't seem to work either (in dash or bash).
eval foobarbaz
This may not be practical since it needs to be done for every alias use.
--
Jilles Tjoelker
next prev parent reply other threads:[~2015-07-26 18:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-26 9:23 Ignored alias inside for loop Rusty Bird
2015-07-26 15:26 ` Jilles Tjoelker
2015-07-26 16:09 ` Rusty Bird
2015-07-26 18:41 ` Jilles Tjoelker [this message]
2015-07-27 8:24 ` Seb
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=20150726184159.GB4346@stack.nl \
--to=jilles@stack.nl \
--cc=dash@vger.kernel.org \
--cc=rustybird@openmailbox.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.