From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22537 invoked by alias); 1 Apr 2010 14:36:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27853 Received: (qmail 27262 invoked from network); 1 Apr 2010 14:36:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100401073618.ZM10593@torch.brasslantern.com> Date: Thu, 01 Apr 2010 07:36:18 -0700 In-reply-to: <20100401082624.GA56998@redoubt.spodhuis.org> Comments: In reply to Phil Pennock "Re: Is this a bug? Why not?" (Apr 1, 1:26am) References: <100330224612.ZM1818@torch.brasslantern.com> <20100331060602.GA91691@redoubt.spodhuis.org> <100331081153.ZM2688@torch.brasslantern.com> <20100401082624.GA56998@redoubt.spodhuis.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Is this a bug? Why not? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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. However, it's not even necessary to do the ${:-*} thing, ${~~foo-*} is sufficient. 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.