zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: <zsh-workers@sunsite.dk>
Subject: RE: ${...%%=*} problem
Date: Thu, 7 Jun 2001 11:29:34 +0400	[thread overview]
Message-ID: <000301c0ef23$99be1900$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <200106070702.JAA24159@beta.informatik.hu-berlin.de>

>
> > bor@itsrm2% print ${foo%%=*}
> > zsh: * not found
> >
> > Why?
>
> Because it does expansion, include the one after an equal sign:
>

This violates our own documentation:

They are followed by _process
substitution_, _parameter expansion_, _command substitution_,
_arithmetic expansion_ and _brace expansion_ which are performed in one
step in left-to-right fashion.  After these expansions, all unquoted
occurrences of the characters `\', `'' and `"' are removed, and the
result is subjected to _filename expansion_ followed by _filename
generation_.

and later

If a word begins with an unquoted `=' and the EQUALS option is set, the
remainder of the word is taken as the name of a command or alias.  If a
command exists by that name, the word is replaced by the full pathname
of the command.

Granted, we do not have strict definition of ``word'' (as opposed to POSIX
:-). In this context I suspect it more like POSIX ``field''. Still, =
expansion happens after parameter substitution - not at the same time (and,
actually, here it happens even before).

-andrej


  reply	other threads:[~2001-06-07  7:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-07  6:42 Andrej Borsenkow
2001-06-07  7:02 ` Sven Wischnowsky
2001-06-07  7:29   ` Andrej Borsenkow [this message]
2001-06-07 14:58     ` 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='000301c0ef23$99be1900$21c9ca95@mow.siemens.ru' \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=zsh-workers@sunsite.dk \
    /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).