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=-5.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 754 invoked from network); 26 Sep 2022 08:12:29 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Sep 2022 08:12:29 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1664179949; b=k3B1ALb+2+1N/x2eC+m+yFW4UMeA2OCLRHtGFK4n/cnHdSrYLArVIYBP7RKrdOCQmvNLMyO6MH BEdGiLUGw+zH9MHg0gKvV9WSc5z/gcn9Z2VZ8isGfRoy7q7+iBWTk+6VjIXYfbcBkhmo8gQy4M /8VB9a+e6O4x1NXhl5qAqbsgpXaHAToCQiBtiHHRoNwBF7eK88zkKF9hBaiaeHDa+uFSVnR45h gqCRmMx62EdavRJDkIm9c7OZWQ2WF43immtz06p7V5VoRBMf7CHb0I0Xhi8LRpos3HuJkfFfLF Su53nmDSJ5R4K6sdl+Wh4b+r5rjo/nsJVfaNtH5OUj+wSA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (p3plsmtp22-04-2.prod.phx3.secureserver.net) smtp.remote-ip=68.178.252.60; dmarc=none header.from=rayninfo.co.uk; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1664179949; bh=NTLLmK3ktqGY8gBTGFxicghLL75otpi9XXAjU7p1Xwo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=EMMauU4smuYdPtMu3G1CjJ21rgPj5TV3xtk6Ah3Aqc0kcULOYmD44c6+sJ5E3Rp2C5GifqJ8ws CImju8xuffD4iS2I5fNNnsf0/9ECqfN1PY4jvbrghZbeMtaY9+WQq/oY7y84uMRFL2FNHPUrfy CCa8N1elnCBdI7ydkZSLbbMvERheT8/hTdW46SeEwqBhbw9VjEIN/YVdWEj/Wi+VPKLra38aO7 pspnyuFK82FFpHLRWXU6FQCukZF1KiZmwQUA19llNGd5ZYIZP1HtF4vKpTCJb6Cabd1jWJ4h+I ZxZFMhmHxabV7cc8fs3pj+Cjkz3cQUdWxi7psRy/Fx6g5g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=XcfP/yXgj5Exrdzc9r4mDV4aWnXSsCE6xsRPBBqgK1Q=; b=FIOoreqZ02oI9ZMVCKacOZEddN foM0g0p1Jt2m++z2aP4TuRwRhrsecniumgpW4YpWdhS9MpX0/D5xBh73zt3c9qQLzobJpipDSJ6YC ALamlaF79dETfGJIElncN56TLnnsJpqTiC8NVCKW6obPWea+Lm/Tqh3Wq0KOTMOhnDS/7YCgz/t6K I4eE+MZDKFuISET+MnRDGDo1n4IyTG4U1CenKsXksUiPemuUax9BZ3p+5vTEeSF660qU2+K7haJ61 QfiNRKlNE9wMUTMDPPy8RhGboQ8CKbragCGeF1GnXyiOKo7+76Fv4xSvtZgnGw6gEFml4255vUM1o r/zGcfmQ==; Received: from authenticated user by zero.zsh.org with local id 1ocjE4-0009Z1-Bm; Mon, 26 Sep 2022 08:12:28 +0000 Authentication-Results: zsh.org; iprev=pass (p3plsmtp22-04-2.prod.phx3.secureserver.net) smtp.remote-ip=68.178.252.60; dmarc=none header.from=rayninfo.co.uk; arc=none Received: from p3plsmtp22-04-2.prod.phx3.secureserver.net ([68.178.252.60]:48598 helo=p3plwbeout22-04.prod.phx3.secureserver.net) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1ocjCp-0008rs-NU; Mon, 26 Sep 2022 08:11:12 +0000 Received: from mailex.mailcore.me ([94.136.40.142]) by :WBEOUT: with ESMTP id cjCmodC1nBwOMcjCnoubUj; Mon, 26 Sep 2022 01:11:09 -0700 X-CMAE-Analysis: v=2.4 cv=cvReL30i c=1 sm=1 tr=0 ts=63315e9d a=s1hRAmXuQnGNrIj+3lWWVA==:117 a=UNgyr3XT6yv5NrNUVILU/Q==:17 a=1HjCxttUbyEA:10 a=IkcTkHD0fZMA:10 a=xOM3xZuef0cA:10 a=Ql7gI5YEbPgay0KeFukA:9 a=QEXdDO2ut3YA:10 X-SECURESERVER-ACCT: david@rayninfo.co.uk X-SID: cjCmodC1nBwOM Received: from [95.145.222.232] (helo=[192.168.1.231]) by smtp13.mailcore.me with esmtpa (Exim 4.94.2) (envelope-from ) id 1ocjCi-00080z-Lk for zsh-users@zsh.org; Mon, 26 Sep 2022 09:11:08 +0100 Message-ID: <807cfc5a-78e0-d74f-160c-f68d2c463997@rayninfo.co.uk> Date: Mon, 26 Sep 2022 09:11:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: Append newline to many files Content-Language: en-US To: zsh-users@zsh.org References: From: zzapper In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailcore-Auth: 8308408 X-Mailcore-Domain: 840527 X-123-reg-Authenticated: david@rayninfo.co.uk X-Originating-IP: 95.145.222.232 X-CMAE-Envelope: MS4xfIhntehXUZEbN16eqGVi7JrYYv6cp7N5RYRhau1JReSldxb3Ls8t3G3pw5cypFa+I/46w7oRvlcSa52oCQtOfH/lFmIBl+YgCq6ufiTMRHD9CTd+kOxT wq7JPyCAvn7S50yLcKtvBuQJEDE4xg2YvppekPygPYet3KdXnL+l0oZRxMpLDYhRCLualMWNNZu0JQ== X-Seq: 28141 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 25/09/2022 14:30, Roman Perepelitsa wrote: > On Sun, Sep 25, 2022 at 3:21 PM Dominik Vogt wrote: >> Assume there are thousands of text files that are not terminated >> with a newline. I want to concatenate them all, but add the >> missing newline between files. >> >> This works but takes ten times as much time as "cat foo.*". >> >> for i in foo.*; do cat "$i"; echo; done > out >> >> I can't really think of a fast yet simple solution. > This should work: > > print >lf > files=(foo.*) > lf=(lf) > cat -- ${files:^^lf} > rm lf > > Roman. > This looks interesting but any chance of an explanation of how it works for us lesser mortals please? zzapper