From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20366 invoked by alias); 19 Dec 2014 03:06:38 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19581 Received: (qmail 11577 invoked from network); 19 Dec 2014 03:06:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) 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.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=b6gFOWC0 c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=A92cGCtB03wA:10 a=WgPT3TlIR2AkbFJ-L50A:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141218190653.ZM16331@torch.brasslantern.com> Date: Thu, 18 Dec 2014 19:06:53 -0800 In-reply-to: <54937E5B.2020008@eastlink.ca> Comments: In reply to Ray Andrews "surprise with echo" (Dec 18, 5:24pm) References: <54937E5B.2020008@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: surprise with echo MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 18, 5:24pm, Ray Andrews wrote: } } Why should it do that? It's very cool what it permits } as explained in 'the book' p. 288, but is the above } part and parcel of that? The doc spells this out explicitly: RC_EXPAND_PARAM (-P) Array expansions of the form `FOO${XX}BAR', where the parameter XX is set to (A B C), are substituted with `FOOABAR FOOBBAR FOOCBAR' instead of the default `FOOA B CBAR'. Note that an empty array will therefore cause all arguments to be removed. } Can that be prevented? Only by turning off the option, or by doing e.g. ${@:-''} so that the expansion is the empty string rather than the empty array. } Is this a feature? It's how array expansion works in the "rc" shell, which is the source from which this behavior is borrowed. There's probably an "rc" list somewhere where you might get an explanation.