From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3666 invoked by alias); 19 Dec 2014 01:54:53 -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: 19576 Received: (qmail 18548 invoked from network); 19 Dec 2014 01:54:50 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, T_HDRS_LCASE,T_MANY_HDRS_LCASE autolearn=ham version=3.3.2 X-Authority-Analysis: v=2.1 cv=T/C1EZ6Q c=1 sm=1 tr=0 a=7RdanbHzwoPNWkp1ouN4hg==:117 a=7RdanbHzwoPNWkp1ouN4hg==:17 a=G8GL833Es-AA:10 a=IkcTkHD0fZMA:10 a=2xUIct00wb8JwHvKWS8A:9 a=QEXdDO2ut3YA:10 Message-id: <54937E5B.2020008@eastlink.ca> Date: Thu, 18 Dec 2014 17:24:43 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-version: 1.0 To: Zsh Users Subject: surprise with echo Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit test() { echo "echoing1: $@" echo "echoing2: $*" echo "echoing3: $* $@ killed" echo "echoing4: $@ $* dead" } $ test echoing2: ... that catches me completely by surprise. " $@ " anywhere in the string kills it dead. I traced it back to: setopt rc_expand_param 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? Of course there's nothing to print, but why kill the entire string? Something about a null array? Can that be prevented? It's all fine if there is an argument, of course. Is this a feature? One could deliberately design it so that nothing gets printed in case of no argument, still it seem counterintuitive.