From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31663 invoked from network); 20 Jan 2021 16:41:08 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 Jan 2021 16:41:08 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1611160868; b=eME8+AtZhctAKf0Xmx9jen4uYUUpn0A+wwC4jRPZJ5dMIgHWx63Tbgpv78I3LNgEMrtznW8vT5 //kCo77p/cmDxoi5x/JjQEBlU3sy7kYoc7IDlaIZq7gn2W0Z6FfqJkn91dKEoSXUKFnErpDhw4 4TU4CTsOrB0eBr7jfZo76WJasJrFSibnQYy1lDo3iGl+K833bfejQmCF5bW83mFucy0ThROmv5 KdEtW7l5aIVI3JsCdmINHxGr1iYGpKs0k0CxGYM7ZTdmK3IQE6ahbQuJwGW5mwda/yERcGqZJ9 rrBup6d07sWgRc2qxhXKO7CI3eZ8kq5j6cbU2tYV30q8OA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-qt1-f179.google.com) smtp.remote-ip=209.85.160.179; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1611160868; bh=2Qu5cQ6gMNg4qmzpR2ApqhS7bhmxKHX1sbzU7unMYw0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:DKIM-Signature: DKIM-Signature; b=OPBmvz3bbOEbwtQJSIv89qIQvRGzsA7R+XxCFoU443ZuW55xm+hO9I+EJHhQ/CXcAxc9BGFVuI tdcgiAAKGHY2dGoFas9RaO8JHS9qkFFhy3hylYWpbRjsBQD5+xp8G47nJCOMvsOKRE6b5Dp+0a j8VPCgLYVOBdpETHl2TkVlcJAtoVQ9c0YiqUAS4twuS7C30C7XWbWfm9TeXrMzp5oAqVtFMNx8 Y1+BSnZmVHKwfvPWt3VkYD1iY+KR224vP9HsNjpnG1wkDC/uhazZ9++cU5Zm9x2+Awpq7I68I7 FAxI7rOLmXAgK37OLABO1ymWSE6A42hTcMQQrX5rjphT9A==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=VbrUev9E01LoBi0bA0Lu0brq2GHRJtljcrVT639OMOY=; b=xzIKezORQKM1iwye7aTe6SCRu0 +TPqfiKcKVYB59Cnccwo7OwLOwermR9r+m5RSw48aERB6huIPZwy5H9EQdmsyF58lRhRUWh1UmS3d 9HjDrux/mTXdWDO7q4F9REgJ7gLgXHwHlDZItjry939CB73Uffq0up2MF4/hJVvKQUhLgH8re1ncd qIeYwyTJ4HEunGx3DLf1hdGN9hpvYNw0Rbt08RmoOZcZbnIkF2wHttp+uAvsvSGSriZH63w6TnFQF /RsPOoTUXrjVX0gI4J/nSxX4GmxV42kGIO6Jytb83EiDtdDmMlbUIbVhbxeTDm+HOA2rMKF15GqnO fncYzHPA==; Received: from authenticated user by zero.zsh.org with local id 1l2GXb-000Ggt-Cf; Wed, 20 Jan 2021 16:41:07 +0000 Authentication-Results: zsh.org; iprev=pass (mail-qt1-f179.google.com) smtp.remote-ip=209.85.160.179; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-qt1-f179.google.com ([209.85.160.179]:36685) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1l2GXP-000GXf-Ku; Wed, 20 Jan 2021 16:40:57 +0000 Received: by mail-qt1-f179.google.com with SMTP id e17so7571055qto.3 for ; Wed, 20 Jan 2021 08:40:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=VbrUev9E01LoBi0bA0Lu0brq2GHRJtljcrVT639OMOY=; b=AsAsDpsXHR8S5Vzlr2JrJbmky/hjjwnxp2iuP3sPm0RPXIdOj8Cd2bIHJv9sYOgB5D /IZ/ZScVf5gmmytpckRxyaoYumfkS62EOjG7pbBmLV/3y0t2sm0I9wk5y5atvyI/WFEY nMWHRlEsLdjj0kggJ5Ovc6H+BkoWI9LlgiPYIYNBa8IAygIAWeqGe9sJU+0hN4T17/IX NwYNZu07y5G9cygf410LUgqhH3nzZIlfNv1qbxyiycZW8puaiQJiBpgzBUflRax91HjT EBBmn8enUYBKH4grtvjihal7y2etsXWzVktjTL/symh9X/Wo2CnISuRwiO+u08FRW5fG sCjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=VbrUev9E01LoBi0bA0Lu0brq2GHRJtljcrVT639OMOY=; b=Lj3OIzf/4u9EH4bWBRvTQKnao6fYmO7HD05VWhPzLwMQNfAnHcezd+UQUhZv3RuyDF T3+iX6n88nusoyQbKZ5APNGhMgMjDgN62l1FzAXTAhcShqzQV2zLvioDwk2ZLdak3py6 qxyknoiVqvSUkYcPwjYiqz0RgAZKINMQpLbrTkpemLN4Gg11a37Tuz2pP7RB7Rci0mhN zVMOC/Jz1k7of0Z3Rnu8Sb7rTzzxI6P2NmKY/IPSGiezSYK3GGfFR8CC0uktG1mSP772 dJ09FWCOe96qgKPYIpD7NrXIzLzU2NkQ+sO+BJw40SDFMo9CYGTNl5Hjl6/g3oObudls EsNg== X-Gm-Message-State: AOAM532Ttg9pO6KYaVPBtBtJB3ufTZdyHxY1idSX91AQuFRvrlDCIKuS AR1fpVoZ8KHGyFhnBdBYfpOFNjHBqwTcOA== X-Google-Smtp-Source: ABdhPJzsXpUnvptMqK079yOnTQbSRAda+OOYklMJz6bpWFJfUf80wEHwc26gIv/GhJms07nF9s6JAw== X-Received: by 2002:ac8:5bc2:: with SMTP id b2mr2315672qtb.98.1611160854724; Wed, 20 Jan 2021 08:40:54 -0800 (PST) Received: from ?IPv6:2804:14c:4783:8889:cc86:e5d3:62c4:635d? ([2804:14c:4783:8889:cc86:e5d3:62c4:635d]) by smtp.gmail.com with ESMTPSA id z16sm429146qtb.73.2021.01.20.08.40.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Jan 2021 08:40:54 -0800 (PST) Subject: Re: zsh adds empty string to local parameter when += is used To: Daniel Shahaf Cc: zsh-workers@zsh.org References: <20210120163136.GB5930@tarpaulin.shahaf.local2> From: jamil bio Message-ID: Date: Wed, 20 Jan 2021 13:40:51 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210120163136.GB5930@tarpaulin.shahaf.local2> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Seq: 47855 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: Thanks Peter S for your amazing explanation. That is enough for me. I had given up on getting an explanation but that is excellent news. I will be using `local -a` and your other suggestions in the future. Cheers, J On 20/01/2021 13:31, Daniel Shahaf wrote: > jamil bio wrote on Wed, Jan 20, 2021 at 13:16:54 -0300: >>         echo "${#files[@]} -- ${files[@]}" >> >> 2 --  file1 >> 3 --  file1 file2 >> 4 --  file1 file2 file3 > For future reference, there's «typeset -p files» and «print -r -- "${(q)files}"».