From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Christian Neukirchen <chneukirchen@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: exec -a and parameter expansion
Date: Fri, 7 Jan 2011 17:56:16 -0500 [thread overview]
Message-ID: <20110107225616.GA99800@redoubt.spodhuis.org> (raw)
In-Reply-To: <8739p4wekt.fsf@gmail.com>
On 2011-01-07 at 23:09 +0100, Christian Neukirchen wrote:
> trying to write a script that sets argv[0] for a child process, I tried
> using exec -a and noticed this difference:
>
> % zsh -c 'exec -a $OSTYPE ps ax' |grep ax
> 3755 pts/19 RN+ 0:00 ?OSTYPE ax
>
> % bash -c 'exec -a $OSTYPE ps ax' |grep ax
> 3876 pts/19 RN+ 0:00 linux-gnu ax
>
> I expected the latter output for zsh too. (And I can't explain the "?".)
In part it depends upon the OS, locale and what happens for unprintable
characters for you.
For me, that's hex [92 77 94 69], shown as [\ M ^ E].
> Is this a bug?
Yes. Looks like another one I introduced, I never tested the
interaction of "exec -a foo" with a variable as foo.
Unfortunately, my understanding of zsh's internal parse state is weak
enough that I don't know the fix. Somewhere in the BINF_EXEC handling,
I *think* that some kind of unmeta() is needed, but my naive approaches
have not worked.
-Phil
next prev parent reply other threads:[~2011-01-07 22:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-07 22:09 Christian Neukirchen
2011-01-07 22:56 ` Phil Pennock [this message]
2011-01-08 2:17 ` Bart Schaefer
2011-01-08 2:32 ` Bart Schaefer
2011-01-08 21:52 ` Peter Stephenson
2011-01-08 22:29 ` Peter Stephenson
2011-01-09 1:18 ` 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=20110107225616.GA99800@redoubt.spodhuis.org \
--to=zsh-workers+phil.pennock@spodhuis.org \
--cc=chneukirchen@gmail.com \
--cc=zsh-workers@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).