Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: exec -a and parameter expansion
- X-seq: zsh-workers 28593
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Christian Neukirchen <chneukirchen@xxxxxxxxx>
- Subject: Re: exec -a and parameter expansion
- Date: Fri, 7 Jan 2011 17:56:16 -0500
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d200912; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=7M+UvE9AsHL5oKatEnZ4LzmEr7h9JzT4+4CB+f+xaz0=; b=YxsNjaiJ+HLh72NBFR7B0kkkveJKMP8lGxF5su82874QyZmwULjRmOdEPQl4jrXRtM+M9f9SdmvL70ImHSF0SbHwOYudDeSOp4ypD8FzeS+qRWS8lLN7BrnoVx+Xj6VdrNlOVLbeNgiqrZdZIcxxsL3NAkB8vvWfC8ELmXSVjGg=;
- In-reply-to: <8739p4wekt.fsf@xxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: Christian Neukirchen <chneukirchen@xxxxxxxxx>, zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <8739p4wekt.fsf@xxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author