Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is this a bug? Why not?
- X-seq: zsh-workers 27854
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Is this a bug? Why not?
- Date: Thu, 1 Apr 2010 14:57:53 -0700
- 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=55AgEiKN+pBvuAq4k/iu1eeY6bGlyvOeGAS6/5tauHo=; b=BeFCDmhyPwAKjEgcB6Zot6HTmMByPgNpaD83GMXECiKefKo5p4kLuzoVzcPepKV0jl0x1EItaiFNmJH31kAeeHL3rR3fHnPbduaG6lpfyCQb+1iFUspWNPK/X3BV5mooGzWndQoACWYWJ6L+ppjmPHJRTgTkv87qXcxDsXTMYws=;
- In-reply-to: <100401073618.ZM10593@xxxxxxxxxxxxxxxxxxxxxx>
- 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: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <100330224612.ZM1818@xxxxxxxxxxxxxxxxxxxxxx> <20100331060602.GA91691@xxxxxxxxxxxxxxxxxxxx> <100331081153.ZM2688@xxxxxxxxxxxxxxxxxxxxxx> <20100401082624.GA56998@xxxxxxxxxxxxxxxxxxxx> <100401073618.ZM10593@xxxxxxxxxxxxxxxxxxxxxx>
On 2010-04-01 at 07:36 -0700, Bart Schaefer wrote:
> On Apr 1, 1:26am, Phil Pennock wrote:
> } Subject: Re: Is this a bug? Why not?
> }
> } On 2010-03-31 at 08:11 -0700, Bart Schaefer wrote:
> } > Incidentally, this came up because of a discussion on the POSIX standards
> } > mailing list (austin-group) in which David Korn just asserted that he'd
> } > like to add the syntax ${"var"} which means to expand the value of var
> } > as if it's quoted (what zsh's normal mode does all the time).
> } >
> } > I was hoping to be able to say "Oh, zsh already has syntax XYZ for that"
> } > but in fact we don't -- zsh either always, or never, does it, depending
> } > on the globsubst option; there's no way to flip globsubst on the fly.
> }
> } No *neat* syntax.
> }
> } % ls
> } lib viewvc.conf
> } % print -l ${~~foo-${(~):-*}}
>
> That isn't really what you mean, is it? The (~) flag only applies to
> the (j::) et al. strings.
Oh, interesting, I missed that glob_subst wasn't affecting the default
at all.
> However, it's not even necessary to do the ${:-*} thing, ${~~foo-*} is
> sufficient.
Okay, *phew*, I did understand the problem statement.
> For austin-group purposes, however, I was hoping for something that did
> not rely on parameter expansion flags. E.g., why doesn't the following
> cause $foo to be quoted?
>
> schaefer[516] ARGV0=sh Src/zsh
> $ foo="???"
> $ print ${foo+"$foo"}
> Doc Etc Src
> $
>
> It works in bash.
Defining "works" as seeing ??? emitted: it works in zsh with glob_subst
disabled. It works in FreeBSD /bin/sh ...
Is this use-case important enough to warrant yet another option?
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author